发现另一个数据中心中的节点 [英] Discover nodes from another datacenter

查看:52
本文介绍了发现另一个数据中心中的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从Cassandra集群中的另一个数据中心发现节点列表?

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

让我们说我有以下信息:

Let us say I have the following information:

  1. 我的Cassandra群集由多个数据中心(例如"dc1"和"dc2")组成.
  2. 我从数据中心"dc1"知道一个节点的IP地址.

使用 datastax Java库,我尝试执行以下操作:

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

  1. 直接从 system.peers 表中读取对等方列表-但是它仅返回其中的一些(以一致性级别 ALL 读取),全部属于"dc1";

  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";

使用 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.

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

这篇关于发现另一个数据中心中的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆