ES集群Master节点配置问题

ES集群的主节点发现机制采用单播形式,主要配置有三行,如下:

discovery.zen.minimum_master_nodes: 2
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["localhost:9001","localhost:9101","localhost:9701"]

第一行的配置说明如下:

# Discovery infrastructure ensures nodes can be found within a cluster
# and master node is elected. Multicast discovery is the default.

# Set to ensure a node sees N other master eligible nodes to be considered
# operational within the cluster. This should be set to a quorum/majority of 
# the master-eligible nodes in the cluster.
#
discovery.zen.minimum_master_nodes: 2

了解Zookeeper的话,这个配置就比较容易理解了; 数值取值为 (有资格当选为Master的节点个数/2+1), 这样做是为了防止脑裂现象, 防止某些主节点自成一个集群. 考虑到Zookeeper的一些配置, 主节点的个数最好是奇数个,并且不少于3个;但是会带来一个问题,如必须至少一半以上的主节点是可用的,如果不能满足这个要求,则系统就会崩溃.

 

第二行和第三行的配置说明如下:

 

# Unicast discovery allows to explicitly control which nodes will be used
# to discover the cluster. It can be used when multicast is not present,
# or to restrict the cluster communication-wise.
#
# 1. Disable multicast discovery (enabled by default):
#
discovery.zen.ping.multicast.enabled: false
#
# 2. Configure an initial list of master nodes in the cluster
#    to perform discovery when new nodes (master or data) are started:
#
discovery.zen.ping.unicast.hosts: ["localhost:9001","localhost:9101","localhost:9701"]

 

1是关闭多播,采用单播;置为false

2是给出所有的Master节点的IP和Port.端口用数据交换接口即可;

 

集群的节点打算分三种角色, master节点,仅充当master作用,不存储数据; data节点, 仅存储数据,不能当选为master节点; observer节点, 既不充当master,也不存储数据;

 

转载于:https://www.cnblogs.com/wmx3ng/p/4707838.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值