elasticsearch 节点未加入集群

elasticsearch 节点未加入集群

我有三个节点应该自动配置成一个集群,但是由于某种原因,它们似乎不想集群。

3 个 Hyper-V VM 服务器是 CENTOS 7,仅安装了工具包。这些服务器在同一子网中具有连续的 IP,没有启用防火墙 - 它们都可以通过 DNS 和 IP 相互 ping。所有服务器上的端口似乎都是开放的。

[root@manelasticshard01 ~]# netstat -tuplen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name
tcp        0      0 10.1.247.246:9200       0.0.0.0:*               LISTEN      993        26721      3913/java
tcp        0      0 10.1.247.246:9300       0.0.0.0:*               LISTEN      993        23402      3913/java
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          20731      1549/sshd
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          19136      2441/master
tcp6       0      0 :::22                   :::*                    LISTEN      0          20733      1549/sshd
udp        0      0 127.0.0.1:323           0.0.0.0:*                           994        16999      913/chronyd
udp6       0      0 ::1:323                 :::*                                994        17000      913/chronyd

除了 IP 地址外,其他所有地址的输出均相同

节点 3

 "cluster_name" : "PACMAN",
  "nodes" : {
    "NlrIawYrR1aq79P6F_Q3zA" : {
      "name" : "node3",
      "transport_address" : "manelasticshard03/10.1.247.244:9300",
      "host" : "10.1.247.244",
      "ip" : "10.1.247.244",
      "version" : "2.2.0",
      "build" : "8ff36d1",
      "http_address" : "manelasticshard03/10.1.247.244:9200",
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 3968,
        "mlockall" : false
      }
    }
  }
}

节点 2

"cluster_name" : "PACMAN",
  "nodes" : {
    "9Sv2k73BTFSgxMDRDdpRgA" : {
      "name" : "node2",
      "transport_address" : "manelasticshard02/10.1.247.245:9300",
      "host" : "10.1.247.245",
      "ip" : "10.1.247.245",
      "version" : "2.2.0",
      "build" : "8ff36d1",
      "http_address" : "manelasticshard02/10.1.247.245:9200",
      "process" : {
        "refresh_interval_in_millis" : 1000,
        "id" : 3898,
        "mlockall" : false
      }
    }
  }
}

节点 1

   "cluster_name" : "PACMAN",
      "nodes" : {
        "RborUe8CS_C7ynX_yFWJ6Q" : {
          "name" : "node1",
          "transport_address" : "manelasticshard01/10.1.247.246:9300",
          "host" : "10.1.247.246",
          "ip" : "10.1.247.246",
          "version" : "2.2.0",
          "build" : "8ff36d1",
          "http_address" : "manelasticshard01/10.1.247.246:9200",
          "process" : {
            "refresh_interval_in_millis" : 1000,
            "id" : 3913,
            "mlockall" : false
          }
        }
      }
    }

我的配置目前如下,但我已经几乎经历了我能找到的所有设置。

cluster.name: PACMAN
node.name: "node3"
# node.master: false
# node.data: true
network.host: manelasticshard03
# http.port: 9230
discovery.zen.ping.unicast.hosts: [manelasticshard01, manelasticshard02]
discovery.zen.ping.multicast.enabled: false
# discovery.zen.ping.unicast.enabled: true
# discovery.zen.fd.ping_timeout: 30s
# gateway.expected_nodes: 3
# gateway.recover_after_time: 5m
# gateway.recover_after_nodes: 2
# discovery.zen.minimum_master_nodes: 2

有谁知道为什么节点没有聚类,或者我可以做任何其他测试来找出原因。

更新 - 如果我将发现最小主节点设置为两个以强制集群搜索第二个节点,我会得到以下输出。

[root@manelasticshard01 ~]# curl http://manelasticshard01:9200/_cluster/health?pretty=true
{
  "error" : {
    "root_cause" : [ {
      "type" : "master_not_discovered_exception",
      "reason" : null
    } ],
    "type" : "master_not_discovered_exception",
    "reason" : null
  },
  "status" : 503
}

答案1

尽管我明确允许 elasticsearch 使用的端口范围,但 RHEL/CENTOS 防火墙显然不喜欢 elasticsearch。

将其关闭即可彻底解决问题。

失败>

相关内容