nodetool getendpoints

Provides the IP addresses or names of replicas that own the partition key.

Provides the IP addresses or names of replicas that own the partition key.

Synopsis

nodetool <options> getendpoints -- <keyspace> <table> key
  • Options are:
    • ( -h | --host ) <host name> | <ip address>
    • ( -p | --port ) <port number>
    • ( -pw | --password ) <password >
    • ( -u | --username ) <user name>
    • ( -pwf <passwordFilePath | --password-file <passwordFilePath> )
  • -- separates an option and argument that could be mistaken for a option.
  • keyspace is a keyspace name.
  • table is a table name.
  • key is the partition key of the end points you want to get.

Example

For example, which nodes own partition key_1, key_2, and key_3?
Note: The partitioner returns a token for the key. Cassandra will return an endpoint whether or not data exists on the identified node for that token.
nodetool -h 127.0.0.1 -p 7100 getendpoints myks mytable key_1
127.0.0.2
nodetool -h 127.0.0.1 -p 7100 getendpoints myks mytable key_2
127.0.0.2
nodetool -h 127.0.0.1 -p 7100 getendpoints myks mytable key_2
127.0.0.1