0

If a Cassandra client is given a list of nodes at startup, how does it learn that other nodes exist?

For instance, a client knows a single node IP and asks it for some data. That node acts as a coordinator, finding other nodes in the cluster that hold the data the client requested. The coordinator returns. Is there any part of the Cassandra binary protocol that returns the external address of the node delegated to, along with the requested data?

DeejUK
  • 12,891
  • 19
  • 89
  • 169
  • possible duplicate of [Cassandra seed nodes and clients connecting to nodes](http://stackoverflow.com/questions/10407072/cassandra-seed-nodes-and-clients-connecting-to-nodes) – Don Branson Mar 12 '14 at 14:55
  • No, it's a different question. Seed nodes are used by new nodes in the cluster to find out about each other, and not by the client. – DeejUK Mar 12 '14 at 14:57
  • You're right. Withdrawn. – Don Branson Mar 12 '14 at 15:04
  • 1
    Comments in com.datastax.driver.core.Cluster say: "A cluster object maintains a permanent connection to one of the cluster nodes which it uses solely to maintain information on the state and current topology of the cluster. Using the connection, the driver will discover all the nodes currently in the cluster as well as new nodes joining the cluster subsequently." This doesn't necessarily apply to Cassandra generally, though. – Don Branson Mar 12 '14 at 15:10
  • 1
    The Cluster object is apparently listening for TOPOLOGY_CHANGE messages, though. It seems that clients might be able register for that: http://mail-archives.apache.org/mod_mbox/cassandra-client-dev/201309.mbox/%3C20130906232951.67845808@shy.leonerd.org.uk%3E – Don Branson Mar 12 '14 at 15:17
  • In the datastax driver, Have a look at Cluster's register methods, and Host's StateListener.onAdd() method. – Don Branson Mar 12 '14 at 15:26

0 Answers0