Harvinder Singh
Harvinder Singh

Reputation: 689

Connecting to multi-node Cassandra cluster using Spring Data Cassandra

I have setup a multi-node Cassandra. I am using Spring Data Cassandra for accessing it. Can I pass a comma-separated list to the Cassandra cluster?

<cassandra:cluster contact-points="value1,value2,value3" />

My second question is: Is it required? I may be adding more nodes in the future.

Upvotes: 2

Views: 2423

Answers (1)

Prashanth
Prashanth

Reputation: 96

Answer for Q#1 : Yes. you can pass a comma separated list of contact points. Answer for Q#2 : It is not strictly required, but recommended though.

Additional info

Giving a single node as a contact point is sufficient for any driver. The driver will then automatically identify the entire cluster with the help of topology defined.

But there is a catch

what if that one node is down? So I usually provide couple of nodes to my DataStax driver. (At least one node per rack in a single cluster). Some people provide seed nodes as contact points. This option is also recommended.

Seed Nodes vs Contact Points

Its important to keep in mind the purpose of 'Seed Nodes' and 'Contact Points'. Seed Nodes supports node and topology discovery when the Cassandra Cluster starts up. 'Contact Points' are used by drivers when interacting with the Cassandra Cluster.

Please also refer to your driver's documentation and pay attention to the default topology setting your driver has.

Upvotes: 4

Related Questions