发现另一个数据中心中的节点

编程入门 行业动态 更新时间:2024-10-09 22:24:25
本文介绍了发现另一个数据中心中的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

让我们说我有以下信息:

Let us say I have the following information:

  • 我的Cassandra群集由多个数据中心(例如"dc1"和"dc2")组成.
  • 我从数据中心"dc1"知道一个节点的IP地址.
  • 使用 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

  • 更多推荐

    发现另一个数据中心中的节点

    本文发布于:2023-11-29 10:56:46,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1646196.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:节点   数据中心   发现

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!