Cassandra cluster contact points

1,646 views
Skip to first unread message

Li Wang

unread,
Dec 9, 2013, 6:48:21 PM12/9/13
to java-dri...@lists.datastax.com
Hi,

For a large cluster which contains 100 hosts, what would be the best practice to set the contact points of the cluster?  I know some Cassandra client library provides configuration to auto select the contact points (coordinators). Is there anything similar in the DataStax Client library?

Thanks,

Li

Joaquin Casares

unread,
Dec 9, 2013, 7:04:56 PM12/9/13
to java-dri...@lists.datastax.com
Hello Li,

With the DataStax Drivers, we internally manage the pooling of connections to each host. As long as the driver can connect to the cluster given the provided IP list, there is no additional configuration that's needed for contact points.

However, if you were asking about information on how the driver interacts with coordinator nodes on the Cassandra side, we do have a few load balancing policies:

And you can always modify and write your own, if you need something more advanced:

Cheers,

Joaquin Casares
DataStax
Software Engineer in Test





To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Alex Popescu

unread,
Dec 9, 2013, 7:14:31 PM12/9/13
to java-dri...@lists.datastax.com

On Mon, Dec 9, 2013 at 3:48 PM, Li Wang <li4...@gmail.com> wrote:
For a large cluster which contains 100 hosts, what would be the best practice to set the contact points of the cluster?

Keeping in mind that the Datastax java driver does node discovery automatically, I'd configure the driver with the list of
seed nodes. 


--

:- a)

Li Wang

unread,
Dec 9, 2013, 7:42:30 PM12/9/13
to java-dri...@lists.datastax.com
Thanks for confirming the driver does node discovery automatically. In the case of a list of seed nodes is configured, the driver is able to connect to the cluster as long as one of the seed nodes is up-running, right?

Thanks,

Li

Joaquin Casares

unread,
Dec 9, 2013, 8:29:05 PM12/9/13
to java-dri...@lists.datastax.com
Yes, that's correct. Also, if the driver is already connected and the seed nodes go down, the driver will not automatically disconnect.

Cheers,

Joaquin Casares
DataStax
Software Engineer in Test





Li Wang

unread,
Dec 9, 2013, 8:50:10 PM12/9/13
to java-dri...@lists.datastax.com
Thanks for the confirmation, Joaquin.

Can you please explain a bit more on " the driver will not automatically disconnect"?

1. will the driver automatically failed over to other seed node that is up-running?
2. if not,  what would happen on the cassandra client side?

Thanks,

Li

Joaquin Casares

unread,
Dec 9, 2013, 9:03:50 PM12/9/13
to java-dri...@lists.datastax.com
Sure thing Li.

1) The concept of seed nodes in Cassandra is similar to contact points for the Driver as far as the following is concerned: Seed nodes and contact points are never used for longer than it takes for new nodes, or new driver instances, to connect to a cluster. After the initial connection has taken place, each node is a peer-based node with no special tasks. So if all three nodes disappear from the ring at the same time that only prevents a) new nodes from joining the cluster or b) new instances of the driver from connecting to a cluster. This can quickly be resolved by providing an up-to-date seed list or contact points.

That all being said, the driver will never "failover" to other contact points since if it's already connected, there is no longer a need for them.

2) On the Cassandra side the 3 nodes will be marked as down and a) new nodes will not be able to join the ring and b) only reads and writes to the appropriate replica set will be affected, just as any other downed node would cause.

Hope this helps,

Joaquin Casares
DataStax
Software Engineer in Test





Reply all
Reply to author
Forward
0 new messages