【问题标题】:Why Cassandra nodes do not join cluster?为什么 Cassandra 节点不加入集群?
【发布时间】:2017-11-02 18:07:46
【问题描述】:

我正在尝试创建 Cassandra 的两个节点,两个节点都会启动,但是当我检查nodetool status 时,我得到:

在第一个节点上:

$ nodetool status
Datacenter: eu-central
======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Tokens       Owns (effective)  Host ID                               Rack
UN  10.0.30.83  217.7 KiB  256          100.0%            38068f28-5116-4bd9-89a4-5787a112dd08  1b

在其他节点上: $节点工具状态

Datacenter: eu-central
======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Tokens       Owns (effective)  Host ID                               Rack
UN  10.0.5.247  142.96 KiB  256          100.0%            0667775c-1365-4696-baa7-ce15fea186b3  1a

两个节点在cassandra.yaml 中都有种子:

- seeds: "10.0.5.247,10.0.30.83"

两个节点都可以互相ping通,至于7000端口:

第一个节点:

netstat -anp | grep 7000
(No info could be read for "-p": geteuid()=1000 but you should be root.) tcp        0      0 127.0.0.1:7000          0.0.0.0:*

        LISTEN      -       

第二个节点:

$ netstat -anp | grep 7000
(No info could be read for "-p": geteuid()=1000 but you should be root.)
tcp        0      0 127.0.0.1:7000          0.0.0.0:*               LISTEN      -         

那么,为什么不互相连接呢?

【问题讨论】:

  • 它在 system.log 中有什么说明吗?
  • 我同意克里斯的观点。检查 system.log 中有关与其他节点握手的错误。
  • 已通过将listen_address设置为节点的私有IP修复
  • 另外,node是通过simple snitch启动的,然后我尝试EC2 snitch时,我没有删除数据目录,这也是一个问题

标签: cassandra


【解决方案1】:
  1. 验证它们是否具有相同的集群名称。
  2. 检查两个节点上的 rpc_adress(例如 0.0.0.0)和 listen_address(应该是您在种子列表中列出的那个)。

【讨论】:

    【解决方案2】:

    检查 Cassandra.yaml 中的 cluster_name 变量。它们应该匹配两个节点才能成为环的一部分。

    【讨论】:

      猜你喜欢
      • 2012-11-29
      • 2014-05-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-03
      • 2015-09-08
      • 1970-01-01
      • 2016-08-14
      相关资源
      最近更新 更多