We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can't connect to cassandra if I use host as a key and username, password as a value
$nodes = [ '192.168.0.2:8882' => [ 'username' => 'admin', 'password' => 'pass'] ];
The bug in Cassandra/Cluster.php in method getRandomNode
after shuffle($this->nodes); the host become zero
The text was updated successfully, but these errors were encountered:
My solution
public function getRandomNode() { if (empty($this->nodes)) throw new ClusterException('Node list is empty.'); $array_random_assoc = function($arr, $num = 1) { $keys = array_keys($arr); shuffle($keys); $r = array(); for ($i = 0; $i < $num; $i++) { $r[$keys[$i]] = $arr[$keys[$i]]; } return $r; }; $this->nodes = $array_random_assoc($this->nodes, count($this->nodes)); // shuffle($this->nodes); while(!empty($this->nodes)) { ...
Sorry, something went wrong.
No branches or pull requests
can't connect to cassandra if I use host as a key and username, password as a value
The bug in Cassandra/Cluster.php in method getRandomNode
after shuffle($this->nodes); the host become zero
The text was updated successfully, but these errors were encountered: