0
votes

I'm using Datastax driver for Cassandra on C#. My cluster has 2 servers (each of them is a data-center). When I declare the KEYSPACE as follow:

CREATE KEYSPACE exc WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'DC1' : 2, 'DC2' : 2 }

After that, whether I perform SELECT/INSERT operation, I get this:

cassandra.UnavailableException: Not enough replica available for query at consistency One (1 required but only 0 alive)

I've used the nodetool to check my cluster and found that the nodes are good and no balance problems are seen.

So has anyone come up with similar problem ? What do I have to do to make it work ? Thanks.

1
Yes thx. But after I try CREATE KEYSPACE exc WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'DC1' : 1, 'DC2' : 1 }, the problem is still the same. My 2 servers both may insert data to Cassandra, should I just make it one DC ? - user3464867
As I mentioned earlier marking the duplicate, Your datacenter is named datacenter1. Your Keyspace is looking for DC1 (and dc2) which do not exist. - RussS
Please read the answer to the linked dupe for more detailed info - RussS
OH, I'm sorry to make so stupid mistake. And thank you very much for your time. - user3464867

1 Answers

0
votes

Use nodetool ring or nodetool status to see if there are any nodes marked as being down.