I have two cassandra nodes set up in a cluster:
192.168.188.31
192.168.188.32
I have set the replication factor of my test keyspace to 2:
CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 2 };
When I stop the cassandra service on the second node (192.168.188.32) :
root@ubuntu:~# service cassandra stop
I can still connect to the first one (192.168.188.31) via cqlsh and select all the data.
However I can not connect via PHP.
My code:
<?php
$dsn = "cassandra:host=192.168.188.31;port=9160;host=192.168.188.32;port=9160;";
$db = new \PDO($dsn);
It says:
Fatal error: Uncaught exception 'PDOException' with message 'CQLSTATE[08006] [8] TTransportException: Transport not open' in /path/to/file
Is the PDO supposed to handle this or am I supposed to detect unavailable nodes in all datacenters and clusters I intend to connect to ?
Hi,
I have two cassandra nodes set up in a cluster: 192.168.188.31 192.168.188.32
I have set the replication factor of my test keyspace to 2: CREATE KEYSPACE mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 2 };
When I stop the cassandra service on the second node (192.168.188.32) : root@ubuntu:~# service cassandra stop
I can still connect to the first one (192.168.188.31) via cqlsh and select all the data.
However I can not connect via PHP.
My code:
<?php $dsn = "cassandra:host=192.168.188.31;port=9160;host=192.168.188.32;port=9160;"; $db = new \PDO($dsn);
It says: Fatal error: Uncaught exception 'PDOException' with message 'CQLSTATE[08006] [8] TTransportException: Transport not open' in /path/to/file
Is the PDO supposed to handle this or am I supposed to detect unavailable nodes in all datacenters and clusters I intend to connect to ?