Cassandra Java driver: how many contact points is reasonable?

后端 未结 4 1551
失恋的感觉
失恋的感觉 2020-12-14 09:30

In Java I connect to Cussandra cluster as this:

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

Do

4条回答
  •  情书的邮戳
    2020-12-14 09:42

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

    As you know Cassandra nodes use the seed nodes to find each other and discover the topology of the ring. The driver will use only one of the nodes provided in the list to establish the control connection, the one used to discover the cluster topology, but providing the client with the seed nodes will increase the chance for the client to continue to operate in case of node failures.

提交回复
热议问题