是否有可能从Cassandra集群中的另一个数据中心发现节点列表?
Is it possible to discover list of nodes from another datacenter in a Cassandra cluster?
让我们说我有以下信息:
Let us say I have the following information:
使用 datastax Java库,我尝试执行以下操作:
Using the datastax java library I have tried to do the following:
直接从 system.peers 表中读取对等方列表-但是它仅返回其中的一些(以一致性级别 ALL 读取),全部属于"dc1";
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";
使用 cluster.getMetada().getAllHosts()-但它仅向我返回"dc1"内的主机的完整列表.
use cluster.getMetada().getAllHosts() - but it returns me a full list of hosts only within "dc1".
在没有知道"dc2"中的至少一个节点的情况下,似乎无法获取有关其他数据中心的信息.我错了吗?
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?
推荐答案DC至少应有一个种子.
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.
docs.datastax/en/cassandra/3.0/cassandra/architecture/archGossipAbout.html
更多推荐
发现另一个数据中心中的节点
发布评论