Alexander
Alexander

Reputation: 85

Cassandra big cluster configure the client connection

I've been looking to find how to configure a client to connect to a Cassandra cluster.

Independent of clients like Pelops, Hector, etc, what is the best way to connect to a multi-node Cassandra cluster?

Sending the string IP values works fine, but what about growing number cluster nodes in the future? Is maintaining synchronically ALL IP cluster nodes on client part?

Upvotes: 2

Views: 853

Answers (2)

Patricia
Patricia

Reputation: 934

You will have an easier time letting the client track the state of each node. Smart clients will track endpoint state via the gossipinfo, which passes on new nodes as they appear in the cluster.

Upvotes: 1

Carlo Bertuccini
Carlo Bertuccini

Reputation: 20021

Don't know if this answer all your questions but the growing cluster and your knowledge of clients ip are not related.

I have a 5 node cluster but the client(s) only knows 2 ip addresses: the seeds. Since each machine of the cluster knows about the seeds (each cassandra.yaml contains the seeds ip address) if new machine will be added information about new one will come "for free" on the client side.

Imagine a 5 nodes cluster with following ips

192.168.1.1

192.168.1.2 (seed)

192.168.1.3

192.168.1.4 (seed)

192.168.1.5

eg: the node .5 boot -- it will contact the seeds (node 2 and 4) and receive back information about the whole cluster. If you add a new 192.168.1.6 will behave exactly like the .5 and will point to the seeds to know the cluster situation. On the client side you don't have to change anything: you will just know that now you have 6 endpoints instead of 5.

ps: you don't have necessarily to connect to the seeds you can just connect to any node of since after having contacted the seeds each node knows the whole cluster topology

pps: it's your choice how many nodes to put in you "client known hosts", you can also put all 5 but this won't change the fact that if one node will be added you don't need to do anything on the client side

Regards, Carlo

Upvotes: 2

Related Questions