PLANNED MAINTENANCE

Hello, DataStax Community!

We want to make you aware of a few operational updates which will be carried out on the site. We are working hard to streamline the login process to integrate with other DataStax resources. As such, you will soon be prompted to update your password. Please note that your username will remain the same.

As we work to improve your user experience, please be aware that login to the DataStax Community will be unavailable for a few hours on:

  • Wednesday, July 15 16:00 PDT | 19:00 EDT | 20:00 BRT
  • Thursday, July 16 00:00 BST | 01:00 CEST | 04:30 IST | 07:00 CST | 09:00 AEST

For more info, check out the FAQ page. Thank you for being a valued member of our community.


question

szbhojan_49886 avatar image
szbhojan_49886 asked ·

How do I configure Cassandra to use a virtual IP?

How to Configure Virtual IP in cassandra.yaml file? If there is no VIP, then how client/user will connect to cluster with 4 nodes?

cassandraload-balancing
10 |1000 characters needed characters left characters exceeded

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 ·

@szbhojan_49886 We do not recommend the use of a virtual IP or a hardware/software load-balancer for Cassandra because the clients/apps use the built-in load-balancing policy on the Cassandra drivers.

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 (whitelist 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!

3 comments Share
10 |1000 characters needed characters left characters exceeded

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

Thanks Erick, Stilli have some doubts to clarify, For an example, if a cluster is having 12 nodes, how many seed nodes can be defined? and also, how to configure client to connect the cluster ? Is it necessary to provide client with all the 12 node's IP address to communicate with client ? Actually how client/user will communicate with the cluster if there is no VIP ? Please Clarify .

0 Likes 0 · ·
alex.ott avatar image alex.ott szbhojan_49886 ·

No. You just need to provide several IPs to connect - usually it's recommended to use seed nodes. After driver connects to first IP that responds, it reads information about cluster topology, and gets IPs of the all nodes in the cluster, and can work with them

0 Likes 0 · ·

@alex.ott is correct. As I've stated in my answer, the driver uses the control connection to query the system tables to learn about the cluster topology. Please see the documents I have provided in my answer since they explain it in detail. Cheers!

0 Likes 0 · ·