原文:
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.
2 个回复
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
赞同来自:
在开发环境中,你可以在同一个主机上起多个es节点,默认配置就可以起es集群。而生产环境中es节点会部署在不同主机上,auto-bootstrap不能工作,所以需要配置cluster.initial_master_nodes,discovery.seed_hosts指定master节点,让es节点能正确地加入集群。
https://www.elastic.co/guide/e ... anges