question

jayachandran.radhakrishnan1_183130 avatar image
jayachandran.radhakrishnan1_183130 asked Erick Ramirez answered

Do the drivers support load-balancer VIP for contact points?

[FOLLOW UP QUESTION TO #5114]

Hi Eric,

Thought of asking a follow-up question to the driver, Can we have contact points configured through a Load balancer VIP ?

In another words, do driver supports LB based config to reach cassandra cluter ?

Thanks

Jay

driverload balancing
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered

I've previously answered this question in #4390.

The use of hardware or software load-balancers and/or virtual IPs (VIPs) is not recommended.

The Cassandra drivers use a built-in load-balancing policy and is aware of the cluster topology plus the health of the nodes. When you place a load-balancer or VIP in between the driver and the cluster, the driver loses the ability to intelligently route requests.

For example if you are using the Java driver, by default the driver uses a load-balancing policy that routes queries to the local data centre with a token-aware policy that prefers to route requests to replicas (nodes) that own the data being queried.

The driver knows about the nodes in the cluster because it connects to contact points (a list of node IP addresses) to establish a control connection at startup time. The driver uses the control connection to perform tasks that include querying the system tables to learn about the cluster topology. Using the control connection, the driver also listens for changes to the cluster automatically so it is aware of things like node additions, node outages, new data centres and decommissions in real time.

For this reason, it is not advisable to use external load balancers or DNS virtual IPs since it affects the ability of the drivers to operate in the optimum way.

If you're interested, check out the Java driver documentation on Control connection and Load balancing. Cheers!

Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.