Reputation: 863
I have set up Cassandra in 3 individual machines...say A,B,C , as per the documentation i did change the cassandra.yaml files of each machine like this
Machine A: listen_address = A's IP
rpc_address = A's IP
seeds = A's IP
Machine B: listen_address = B's IP
rpc_address = B's IP
seeds = A's IP
Machine C: listen_address = C's IP
rpc_address = C's IP
seeds = A's IP
Now if B,C any one of them are down I am not able to get records from A,which is expected to get,I am confusing in terms like node,datacenter...In above scenario I thought all are different data centers but when get ring info using nodetool;it shows them in same datacenter (datacenter1) what I need to know is correct setup so that it utilizes Cassandra efficiently
I created keyspace in each node like
create keyspace test
with placement_strategy = 'SimpleStrategy'
and strategy_options = {replication_factor : 1}
and durable_writes = true;
I didnt used any consistentcy level...
Datacenter: datacenter1
==========
Replicas: 1
Address Rack Status State Load Owns Token
849583800602241121
B's IP rack1 Up Normal 156.98 KB 95.39% 0
C's IP rack1 Up Normal 130.3 KB 4.61% 849583800602241121
Upvotes: 0
Views: 1086
Reputation: 934
Setting replication_factor
to 1 means that there is only one copy of each row, on one node. It is possible that you're trying to ask for data that resides on the failed node, which explains why you aren't seeing anything returned.
To your earlier question, a data center is a geographically-grouped collection of individual nodes. Single or multiple data centers can be combined into a single cluster.
Upvotes: 2
Reputation: 200
With a replication factor of 1, we can assume that A's data will be replicated in B, B's data in C and C's data in A and so if 1 machine goes down all your data should still be available [Availability in Cassandra]. What is the error that you are getting when you are trying to query the data?
For a cluster of 3 nodes (machines), a single data centre should suffice unless you are trying to test a setup across geographical locations. Basically, a set of nodes (machines) at one location comprise a data-centre. Hence, your setup is correct and the nodetool is showing the information correctly. Also, it is not required to create the keyspace in each node of your cluster. You can create it on any one node and when the other nodes join cluster, the schema is automatically propagated to the newly joined node.
Upvotes: 0