all task failed with Unavailable when stop one node cassandra, please help me, thanks

174 views
Skip to first unread message

Jet Li

unread,
Dec 3, 2015, 4:43:11 AM12/3/15
to DataStax C++ Driver for Apache Cassandra User Mailing List
Hi,

I have three cassandra node, 100.142.31.176,100.142.31.177,100.142.31.178, 100.142.31.176 is the seed node, I have a demo code that will do some task on all node, when I stop one cassandra and run all task again, all task in all node failed with Unavailable, the error code is: CASS_ERROR_SERVER_UNAVAILABLE

To neil: you can reply on this post, thanks

below is some describe of my Demo code and cassandra.yaml file
void OpenSession()
{
if(m_session != NULL)
{
sessionNum ++;
return;
}

cluster = cass_cluster_new api();
cass_cluster_set_request_timeout(50000);
cass_cluster_set_latency_aware_routing api(cluster, cass_true);
cass_cluster_set_load_balance_round_robin(cluster);
m_seesion = cass_cass_session_new(cluster);

//contact point like "100.142.31.177,100.142.31.176"
const char* cintact_point = GetPointFromConfigFile();
cass_cluster_set_contact_points(cluster, cintact_point );

cass_session_connect(m_seesion, m_cluster);
...
//some other error process operator
...
}
void OpenDB(const string& path)
{
OpenSession();
//get the base keyspace name:
string keyspace_base = SetBaseName();
string keyspace_rep2 = keyspace_base+"_rep2";
string keyspace_rep3 = keyspace_base+"_rep3";
...
//create key space...
create_key_space = "CREATE KEYSPACE IF NOT EXISTS " + keyspace_rep2
+ "WITH replication = { 'class': 'SimpleStrategy', 'replication_factor': '2'} "";";
Future result = cass_session_execute(m_seesion, create_key_space );
cass_future_wait(result);
//check result and do error process;
....
//create other key space and table
....
}

in cassandra.yaml, I set some paramerter and other parameter never set:
1. cluster name
2. seeds ip; 100.142.31.176
3. listen_adress: use the local machine ip of each node,like 100.142.31.177
4. rpc_adress: use the local machine ip of each node,like 100.142.31.177
5. commit log, cache and data path

result:
1. all task can success when all cassandra node is up
2. all task will failed after write some data if one cassandra node down

Best wishes
Liwei

Neil Ablang

unread,
Dec 3, 2015, 6:21:27 AM12/3/15
to cpp-dri...@lists.datastax.com

Liwei,

Can you verify if you stop the cassandra service at one node and check the cluster status via nodetool, there are 2 nodes up and 1 node down? You can run the nodetool on any of the 2 nodes that are supposed to up.

--
You received this message because you are subscribed to the Google Groups "DataStax C++ Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cpp-driver-us...@lists.datastax.com.

Jet Li

unread,
Dec 3, 2015, 7:05:32 AM12/3/15
to DataStax C++ Driver for Apache Cassandra User Mailing List
Hi, Neil

I just verify again, yes there are two node up and one one Down after I stop one cassandra of one node, and I stop it use ./nodetool stopdaemon, and after stop one node cassandra, the other two node can ssh use ./cqlsh also

Best wishes
Liwei

Jet Li

unread,
Dec 3, 2015, 7:15:25 AM12/3/15
to DataStax C++ Driver for Apache Cassandra User Mailing List
Hi, Neil
I just verify again, yes there are two node up and one one Down after I stop one cassandra of one node, and I stop it use ./nodetool stopdaemon, and after stop one node cassandra, the other two node can ssh use ./cqlsh also
PS: in the node cassandra stop still has some task which will use cassandra

Best wishes
Liwei

Message has been deleted

Michael Penick

unread,
May 13, 2016, 12:03:56 PM5/13/16
to cpp-dri...@lists.datastax.com
What is your keyspace's replication factor and query's consistency levels? It looks like C* is unable to fulfill your queries consistency level requirements with 2 nodes.

To get more information for that server error your can inspect a `CassErrorResult` object which is obtained using `cass_future_get_error_result()` (https://github.com/datastax/cpp-driver/blob/2.3.0/include/cassandra.h#L3302-L3316). Then compare the `cass_error_result_responses_received()` vs `cass_error_result_responses_required()` (https://github.com/datastax/cpp-driver/blob/2.3.0/include/cassandra.h#L7181-L7223).

Mike

On Fri, May 13, 2016 at 6:26 AM, no3productionz <no3prod...@gmail.com> wrote:
Hi Jet,

I am having this exact same issue using cpp driver 2.1
On a 3 node cluster, when one node goes down Cassandra is able to connect correctly but then all my prepared statements executions return CASS_ERROR_SERVER_UNAVAILABLE.
I can see nodetool status giving 2 up and 1 down.
Were you able to fix this issue? Is it some kind of configuration problem?
Thanks very much in advance!
Regards!
Reply all
Reply to author
Forward
0 new messages