环境说明:
192.168.1.62: master data
192.168.1.66: master data
192.168.1.63: data
配置文件:
1.62:
cluster.name: es_server
node.name: node-1
network.host: 192.168.1.62
http.port: 9200
cluster.initial_master_nodes: ["node-6", "node-1"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
node.master: true
node.data: true
discovery.seed_hosts: ["192.168.1.66", "192.168.1.62"]
discovery.zen.minimum_master_nodes: 1
1.66:
cluster.name: es_server
node.name: node-6
network.host: 192.168.1.66
http.port: 9200
cluster.initial_master_nodes: ["node-6", "node-1"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
node.master: true
node.data: true
discovery.seed_hosts: ["192.168.1.66", "192.168.1.62"]
discovery.zen.minimum_master_nodes: 1
1.63:
cluster.name: es_server
node.name: node-2
network.host: 192.168.1.63
http.port: 9200
cluster.initial_master_nodes: ["node-6", "node-1"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
node.master: false
node.data: true
discovery.seed_hosts: ["192.168.1.66", "192.168.1.62"]
discovery.zen.minimum_master_nodes: 1
想要配置有三个结点的集群,两个节点具有master资格,一个master node挂掉后另外一个node也可以成为master使集群继续工作。
集群启动正常可以选举出master运行正常,然后手动挂掉master node,发现另外一个具有master资格的node无法成为master,报出警告:
[node-1] master not discovered or elected yet, an election requires a node with id [fNTF4MvpQOmvkiTUeDug7A], have discovered [{node-1}{iFYOCH33Qa6sM4N1mWAifQ}{8OxfwkJ1RYaA77o1hYvhkw}{192.168.1.62}{192.168.1.62:9300}{dilm}{ml.machine_memory=8254783488, xpack.installed=true, ml.max_open_jobs=20}] which is not a quorum; discovery will continue using [192.168.1.66:9300] from hosts providers and [{node-6}{fNTF4MvpQOmvkiTUeDug7A}{eIhqTy2pQaGPaa1R2vmDTg}{192.168.1.66}{192.168.1.66:9300}{dilm}{ml.machine_memory=8254783488, ml.max_open_jobs=20, xpack.installed=true}, {node-1}{iFYOCH33Qa6sM4N1mWAifQ}{8OxfwkJ1RYaA77o1hYvhkw}{192.168.1.62}{192.168.1.62:9300}{dilm}{ml.machine_memory=8254783488, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 1, last-accepted version 22 in term 1
192.168.1.62: master data
192.168.1.66: master data
192.168.1.63: data
配置文件:
1.62:
cluster.name: es_server
node.name: node-1
network.host: 192.168.1.62
http.port: 9200
cluster.initial_master_nodes: ["node-6", "node-1"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
node.master: true
node.data: true
discovery.seed_hosts: ["192.168.1.66", "192.168.1.62"]
discovery.zen.minimum_master_nodes: 1
1.66:
cluster.name: es_server
node.name: node-6
network.host: 192.168.1.66
http.port: 9200
cluster.initial_master_nodes: ["node-6", "node-1"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
node.master: true
node.data: true
discovery.seed_hosts: ["192.168.1.66", "192.168.1.62"]
discovery.zen.minimum_master_nodes: 1
1.63:
cluster.name: es_server
node.name: node-2
network.host: 192.168.1.63
http.port: 9200
cluster.initial_master_nodes: ["node-6", "node-1"]
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
node.master: false
node.data: true
discovery.seed_hosts: ["192.168.1.66", "192.168.1.62"]
discovery.zen.minimum_master_nodes: 1
想要配置有三个结点的集群,两个节点具有master资格,一个master node挂掉后另外一个node也可以成为master使集群继续工作。
集群启动正常可以选举出master运行正常,然后手动挂掉master node,发现另外一个具有master资格的node无法成为master,报出警告:
[node-1] master not discovered or elected yet, an election requires a node with id [fNTF4MvpQOmvkiTUeDug7A], have discovered [{node-1}{iFYOCH33Qa6sM4N1mWAifQ}{8OxfwkJ1RYaA77o1hYvhkw}{192.168.1.62}{192.168.1.62:9300}{dilm}{ml.machine_memory=8254783488, xpack.installed=true, ml.max_open_jobs=20}] which is not a quorum; discovery will continue using [192.168.1.66:9300] from hosts providers and [{node-6}{fNTF4MvpQOmvkiTUeDug7A}{eIhqTy2pQaGPaa1R2vmDTg}{192.168.1.66}{192.168.1.66:9300}{dilm}{ml.machine_memory=8254783488, ml.max_open_jobs=20, xpack.installed=true}, {node-1}{iFYOCH33Qa6sM4N1mWAifQ}{8OxfwkJ1RYaA77o1hYvhkw}{192.168.1.62}{192.168.1.62:9300}{dilm}{ml.machine_memory=8254783488, xpack.installed=true, ml.max_open_jobs=20}] from last-known cluster state; node term 1, last-accepted version 22 in term 1
5 个回复
zqc0512 - andy zhou
赞同来自: zzjxxpro
trycatchfinal
赞同来自: blue_sky
看一下这个文章:Elasticsearch 7.0 Zen2 开启Elasticsearch分布式新纪元
blue_sky
赞同来自:
byx313 - BLOG:https://www.jianshu.com/u/43fd06f9589c
赞同来自:
两主的集群一台master-eligible挂掉以后集群就选不出来master了,为了防止脑裂。
zzjxxpro
赞同来自: