es集群报子节点无法加入主节点的错误
我有一个主节点es-node1,配置如下:
cluster.name: imooc-es-cluster
node.name: es-node1
path.data: /usr/local/elasticsearch-7.4.2/data
path.logs: /usr/local/elasticsearch-7.4.2/logs
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.seed_hosts: ["192.168.57.5", "192.168.57.6","192.168.57.7"]
cluster.initial_master_nodes: ["es-node1"]
有一个从节点es-node7,配置如下:
cluster.name: imooc-es-cluster
node.name: es-node7
path.data: /usr/local/elasticsearch-7.4.2/data
path.logs: /usr/local/elasticsearch-7.4.2/logs
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.seed_hosts: ["192.168.57.5", "192.168.57.6","192.168.57.7"]
cluster.initial_master_nodes: ["es-node1"]
从节点es-node7启动会报无法加入主节点的错误:
请问是什么原因导致的?
正在回答 回答被采纳积分+1
已经找到原因了,是因为少配置了一个配置,network.publish_host,我在视频课程中好像没看到老师配置这个
完整的配置如下:
cluster.name: imooc-es-cluster
node.name: es-node1
path.data: /usr/local/elasticsearch-7.4.2/data
path.logs: /usr/local/elasticsearch-7.4.2/logs
network.host: 0.0.0.0
network.publish_host: 192.168.57.5
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
discovery.seed_hosts: ["192.168.57.5", "192.168.57.6","192.168.57.7"]
cluster.initial_master_nodes: ["es-node1"]
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星