README.md in nogara-redis_failover-0.9.7.3 vs README.md in nogara-redis_failover-0.9.7.4

- old
+ new

@@ -88,10 +88,13 @@ The configuration parameters can also be specified in a config.yml file. An example configuration would look like the following: --- :max_failures: 2 + :node_strategy: majority + :failover_strategy: latency + :required_node_managers: 2 :nodes: - localhost:6379 - localhost:1111 - localhost:2222 - localhost:3333 @@ -113,25 +116,33 @@ any moment, a single Node Manager process will be designated to manage the redis servers. If this Node Manager process dies or becomes partitioned from the network, another Node Manager will be promoted as the primary manager of redis servers. You can run as many Node Manager processes as you'd like. Every Node Manager periodically records health "snapshots" which the primary/master Node Manager consults when determining if it should officially mark a redis -server as unavailable. By default, a majority strategy is used. +server as unavailable. By default, a majority strategy is used. Also, when a failover +happens, the primary Node Manager will consult the node snapshots to determine the best +node to use as the new master. ## Client Usage The redis failover client must be used in conjunction with a running Node Manager daemon. The client supports various configuration options, however the only mandatory option is the list of -ZooKeeper servers: +ZooKeeper servers OR an existing ZK client instance: + # Explicitly specify the ZK servers client = RedisFailover::Client.new(:zkservers => 'localhost:2181,localhost:2182,localhost:2183') + # Explicitly specify an existing ZK client instance (useful if using a connection pool, etc) + zk = ZK.new('localhost:2181,localhost:2182,localhost:2183') + client = RedisFailover::Client.new(:zk => zk) + The client actually employs the common redis and redis-namespace gems underneath, so this should be a drop-in replacement for your existing pure redis client usage. The full set of options that can be passed to RedisFailover::Client are: - :zkservers - comma-separated ZooKeeper host:port pairs (required) + :zk - an existing ZK client instance + :zkservers - comma-separated ZooKeeper host:port pairs :znode_path - the Znode path override for redis server list (optional) :password - password for redis nodes (optional) :db - db to use for redis nodes (optional) :namespace - namespace for redis nodes (optional) :logger - logger override (optional)