Contact points Questions

Hi,
This is James, I am not quiet understanding contact points when some specific situation like below,

For one instance, One universe has 3 nodes and replication setting is 3. and contactpoints in my code is (node1,node2,node3). For cassandra, I figure it will contact any ONE node and get same query result
https://teddyma.gitbooks.io/learncassandra/content/client/which_node_to_connect.html, so technically, my contactpoint can be only node1, and still get same result.

  1. If its still 3 nodes but replication is 1, is there any difference, between if my contact point is (node1,node2,node3) or only (node1)? If I only have 1 node as contact point, can I get same result when I use 3 nodes? or it could be nothing result because data is stored on one the others 2 nodes.

  2. Contact like (node1,node2,node3), YB will pick up a better node to connect? what is the advantage we should or no matter use multiple contact points?

  3. Is it good enough for me to check if we can ping node IP to decide this node is healthy or not?

Thanks in advance

Hi @James_Wang,

Welcome to YugabyteDB forum!

The node will act as a proxy and return the data.

While the driver will discover the remaining nodes (give a few seed nodes), it is a good idea to provide as many hosts as possible upfront. Depending on policy the driver will pick best node.

The driver will handle this automatically and there is no need for manual checking.

Regards,
Dorian
Technical Support Engineer

Hi, Dorian,

Thanks for your reply.

I have another question to follow

If I have a multi value answer domain, means 1 domain can nslookup multiple IP address
looks like below

When I put this domain as contactpoint. does drive behavior like I put 3 node ips or drive will only connect the first ping result, work as I only have 1 node IP?

Which driver are you using ? You can do this manually by doing lookup yourself and then passing 3 hosts/ips when connecting to the cluster.

we are using dot net driver. and my question simply is how driver get IP by DNS, by nslookup or ping?

Looking at the code,

it’s using Dns.GetHostEntry which returns a single IP.

I believe you can use Dns.GetHostAddresses in your code to get all ips and then pass them all to the Cluster object.