Question

I have recently started using Cassandra in our Production environment. We have a 24 node cluster with replication factor of 4. Meaning 2 copies will be there in each datacenter. So that means we have a single cross colo cluster with 24 nodes which means 12 nodes in SLC colo and 12 nodes in PHX colo.

I am using Astyanax client currently to write the data in Cassandra database. And I know Astyanax client has this feature to autodiscover all the nodes in PHX colo or SLC colo of cassandra in its connection pooling but not all of the nodes.

In Astyanax we can use something like below -

setLocalDatacenter("DC1")

Now we are planning to use Datastax Java driver. And I am not sure whether Datastax java driver has this feature or not to autodiscover all the cassandra nodes in its connection pool only for specific datacenter and not all the datacenters?

Était-ce utile?

La solution

The driver will discover all the nodes in your cluster, you want to change your load balancing policy in your client code. Specifically you want to use the dc aware load balancing policy.

http://www.datastax.com/drivers/java/apidocs/com/datastax/driver/core/policies/DCAwareRoundRobinPolicy.html

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top