Discover nodes from another datacenter

纵然是瞬间 提交于 2019-12-24 00:44:40

问题


Is it possible to discover list of nodes from another datacenter in a Cassandra cluster?

Let us say I have the following information:

  1. My Cassandra cluster consists of multiple datacenters (say "dc1" and "dc2").
  2. I know an IP address of one of the nodes from, say, datacenter "dc1".

Using the datastax java library I have tried to do the following:

  1. read list of peers directly from the system.peers table - but it returns just a few of them (it was read with consistency level ALL), all belonging to the "dc1";

  2. use cluster.getMetada().getAllHosts() - but it returns me a full list of hosts only within "dc1".

It looks like there is no way to get this information about other datacenter without knowing at least one node from the "dc2". Am I wrong?


回答1:


There should be at least one seed by DC.

Attention: In multiple data-center clusters, include at least one node from each datacenter (replication group) in the seed list.

https://docs.datastax.com/en/cassandra/3.0/cassandra/architecture/archGossipAbout.html



来源:https://stackoverflow.com/questions/48586726/discover-nodes-from-another-datacenter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!