Commit Graph

3 Commits

Author SHA1 Message Date
Daniele Alessandri e851aaa21d Automatically assign aliases to slave connections. 2016-05-10 14:55:30 +02:00
Daniele Alessandri 7664f1f29b Improve client configuration for redis-sentinel.
Predis\Client now requires a list of connection parameters pointing to
sentinel instances and mandatory options "replication" and "service" set
respectively to "sentinel" and the chosen name for the master instance.

  $sentinels = ['tcp://127.0.0.1:5381', 'tcp://127.0.0.1:5382'];
  $options   = ['replication' => 'sentinel', 'service' => 'mymaster'];
  $client    = new Predis\Client($sentinels, $options);

Despite being nice and clean on the outside I am not really fond of the
code being used internally to make this kind of configuration possible.
Improvements in this respect would require a few breaking changes (not
even an option for a minor release) so things will change for the good
with Predis 2.0.
2016-05-10 14:19:05 +02:00
Daniele Alessandri fda293b573 Add example of replication configuration using redis-sentinel. 2015-08-16 20:25:42 +02:00