我已配置3个节点的弹性搜索我的群集无法找到主节点
弹性搜索日志
[2018-02-24T02:39:39,106][INFO ][o.e.d.z.ZenDiscovery ] [node3] failed to send join request to master [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}], reason [RemoteTransportException[[node1][192.168.2.xxx:9300][internal:discovery/zen/join]]; nested: NotMasterException[Node [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}] not master for join request]; ], tried [3] times
[2018-02-24T02:39:42,332][INFO ][o.e.d.z.ZenDiscovery ] [node3] failed to send join request to master [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}], reason [RemoteTransportException[[node1][192.168.2.xxx:9300][internal:discovery/zen/join]]; nested: NotMasterException[Node [{node1}{MO28S_KZQaih1pd-ERrvIA}{SBwZDgFcTz2xTLOyh2fZAA}{192.168.2.xxx}{192.168.2.xxx:9300}] not master for join request]; ], tried [3] times
我的elasticsearch.yml文件
cluster.name: cluster-testing
node.name: node3
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 192.168.2.xxx
http.port: 9200
discovery.zen.ping.unicast.hosts: ["192.168.2.xxx", "192.168.2.xxx",
"192.168.2.xxx"]
discovery.zen.minimum_master_nodes: 2
gateway.recover_after_nodes: 2
gateway.expected_nodes: 3
我无法找到问题所在
答案 0 :(得分:1)
要将节点变为主节点,您需要添加
node.master: true
进入elasticsearch.yml。
从您的配置
discovery.zen.minimum_master_nodes: 2
至少有两个节点必须将node.master设置为true
编辑:
您可以找到我们项目的以下工作配置(3 *主人和6 *奴隶):
MASTER:
cluster.name: VAL_elasticsearch
node.name: MASTER-${HOSTNAME}
node.data: false
node.master: true
path.data: /data
path.logs: /local/opt/logs
path.repo: ["/home/data_ElasticSearchBackup"]
bootstrap.memory_lock: true
bootstrap.seccomp: false
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["ip_master1","ip_master2","ip_masterx"]
discovery.zen.minimum_master_nodes: 2
从属:
cluster.name: VAL_elasticsearch
node.name: DATA-${HOSTNAME}
node.data: true
node.master: false
path.data: /data
path.logs: /local/opt/logs
path.repo: ["/home/data_ElasticSearchBackup"]
bootstrap.memory_lock: true
bootstrap.seccomp: false
network.host: 0.0.0.0
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["ip_master1","ip_master2","ip_masterx"]
discovery.zen.minimum_master_nodes: 2
您确定所有弹性实例之间的所有端口都是打开的吗?
答案 1 :(得分:1)
我遇到了类似的错误,但情况有所不同。
我试图在同一台计算机上启动2个ES节点。我已经复制了我的ES目录以启动一个新节点,并且得到RemoteTransportException
这个异常。
稍作搜索后,我发现必须删除复制目录中的nodes
目录才能启动该节点。此目录通常位于{ES_HOME}/data/nodes
或/var/lib/elasticsearch/nodes
中。