是时候用 ES 拯救发际线啦

elasticsearch配置文件里两项解释

Elasticsearch | 作者 cherryjiang | 发布于2019年07月31日 | 阅读数:10216

最新版的es配置文件里有两项配置:discovery.seed_hosts和cluster.initial_master_nodes。阅读了es官网上的一些解释,也搜索了网上的一些解释,还是感觉有点疑问。求哪位高人给指点一下,分享下对这两项的理解呢?多谢!
已邀请:

God_lockin

赞同来自: derobukal

这俩主要描述在这里
https://www.elastic.co/guide/e ... .html
https://www.elastic.co/guide/e ... .html
 
大概意思是
seed_hosts以前叫discovery.zen.ping.unicast.hosts,这个之前版本的配置里应该见过吧。
 
initial_master_nodes的话如果普通用,不设的话,集群会默认把第一个启动的当master,其他节点也会去局域网里搜+选主,但是这样比较危险(可能脑裂或者卡在仲裁投票的状态时间太长之类的),所以建议你把有选主资格的节点放里面,这样就不会浪费那么多时间、资源了
 
原文:
discovery.seed_hosts
Provides a list of master-eligible nodes in the cluster. Each value has the format host:port or host, where port defaults to the setting transport.profiles.default.port. Note that IPv6 hosts must be bracketed. The default value is ["127.0.0.1", "[::1]"]. See discovery.seed_hosts. This setting was previously known as discovery.zen.ping.unicast.hosts. Its old name is deprecated but continues to work in order to preserve backwards compatibility. Support for the old name will be removed in a future version.
 
cluster.initial_master_nodes
When you start a brand new Elasticsearch cluster for the very first time, there is a cluster bootstrapping step, which determines the set of master-eligible nodes whose votes are counted in the very first election. In development mode, with no discovery settings configured, this step is automatically performed by the nodes themselves. As this auto-bootstrapping is inherently unsafe, when you start a brand new cluster in production mode, you must explicitly list the master-eligible nodes whose votes should be counted in the very first election. This list is set using the cluster.initial_master_nodes setting.

fantuan

赞同来自:

从7.0开始,es废弃了原来的zen discovery配置项,引入了新的"cluster.initial_master_nodes"配置项。
在开发环境中,你可以在同一个主机上起多个es节点,默认配置就可以起es集群。而生产环境中es节点会部署在不同主机上,auto-bootstrap不能工作,所以需要配置cluster.initial_master_nodes,discovery.seed_hosts指定master节点,让es节点能正确地加入集群。
https://www.elastic.co/guide/e ... anges

要回复问题请先登录注册