What is the best way to detect if a redis server is unavailable and failover to the slave?
Of course, this should be in a timely and efficient manner. I'm using it for centralized PHP session variable storage.
I saw this example on the nrk/predis repo but I believe it is only for sharding, not for failover/replication situations?
$redis = new Predis\Client(array(
array('host' => '10.0.0.1', 'port' => 6379),
array('host' => '10.0.0.2', 'port' => 6379)
));
TL;DR — I want my redis-based PHP sessions to failover to a slave redis server if the master is unavailable.
Help?