Cassandra Java driver: how many touchpoints are reasonable?

In Java, I connect to the cussandra cluster as follows:

Cluster cluster = Cluster.builder().addContactPoints("host-001","host-002").build();

Do I need to specify all hosts of the cluster there? What if I have a cluster of 1000 nodes? How many do I choose at random? How many, do I really do this random?

Solution

I would say that configuring your client to use the same node list as the seed node list you configured Cassandra to use will give you the best results

As you know, Cassandra node uses seed nodes to find each other and discover the topology of the ring The driver will only use one node provided in the list to establish a control connection for discovering the control connection of the cluster topology, but providing a seed node for the client will increase the opportunity for the client to continue running in case of node failure

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>