nrk/phpiredis

predis cluster 2 bug my meet!!

Closed this issue · 1 comments

first question : code
$multiple_servers = array('tcp://127.0.0.1:6388', 'tcp://127.0.0.1:6389');
$options=array('cluster' => 'redis');
$client = new Predis\Client($multiple_servers, $options);
$client->set('predis'.$i,$i);
$value = $client->get('predis'.$i);
echo $value ;
error:Can't inherit abstract function Predis\Cluster\StrategyInterface::getSlotByKey()
solution:ClusterStrategy.php note this ://abstract public function getSlotByKey($key); // abstract public function getDistributor(); and retry result is right

sencond question:when 127.0.0.1:6388 crash ,code will report error 。not use it slave 127.0.0.1:6386;
modify: $multiple_servers = array('tcp://127.0.0.1:6389', 'tcp://127.0.0.1:6388'); the code is right!
so the multiple_servers array first value can't crash !! this is a bug !!! hope correction it !!

nrk commented

Next time, please, at least close your own bug reports blatantly opened on the wrong repository.