0

Using the cassandra cluster manager, I created a cluster with 4 nodes: node1, node2, node3, node4.

Then I used cqlsh to create a keyspace with replication factor 3.

So I guess there should be 3 replicas of my data somewhere. I was expecting, that, if I create a table there would be 3 "copies" distributed over those 4 nodes

But if I stop node1 I can't access the table at all. I'm getting the message that no host is available.

Where is my error in reasoning? How can I set the replication factor so that my data is actually distributed over more than just one node?

  • If you set a replication factor of 3, there will be a total of three instances stored. (See https://stackoverflow.com/questions/24587869/understand-cassandra-replication-factor-versus-consistency-level/24590299#24590299) What's your read consistency set to? – Don Branson Dec 13 '17 at 21:32
  • Also, can you add the actual error message to you question? – Don Branson Dec 13 '17 at 21:33
  • 1
    if I write CONSISTENCY into cqlsh it says "Current consistency level is one ". The error message says only "NoHostAvailable:" – BirnBaumBlüte Dec 13 '17 at 21:49

1 Answers1

2

cqlsh uses a whitelist policy, meaning the client will only connect to the one host. If that 1 host goes down you will get a NoHostAvailable exception and it wont be able to try any of the other nodes. Try connecting cqlsh to a host other than the one you take down or use one of the cassandra drivers with an appropriate load balancing policy.

Chris Lohfink
  • 16,150
  • 1
  • 29
  • 38