I know that it is possible to define more than one master for the ElasticSearch cluster, where only one acts as master and the others can step in if necessary. See also /sf/answers/1051597431/ .
What I don't understand is how I can determine which master is active and which could step in if necessary.
The following setting I currently have:
node-01: master (x) data(-)
node-02: master (-) data(x)
node-03: master (-) data(x)
node-04: master (-) data(x)
node-05: master (-) data(x)
node-06: master (-) data(x)
Run Code Online (Sandbox Code Playgroud)
Now I want to determine that e.g. node-02 becomes additionally a master eligible. Can I rely on ES being so smart that it always takes the non-data node (node-01) as the active master, or could it be that node-02 ever acts as the active master if all nodes are present and there are no problems? Or is that something I just don't have to worry about?
I am currently using ElasticSearch 1.7 [sic!], but I am also interested in answers based on the latest versions.
Zai*_*och 11
稍后,就上下文而言,我们现在“可以”决定哪个节点成为主节点,尽管这不是直接可能的。
Elasticsearch 现在有一个名为Voting_config_exclusions的方法,可用于离开当前的主节点,例如
假设您的集群中有 3 个符合主节点资格的节点
$ GET _cat/nodes?v
ip node.role master name
192.168.0.10 cdfhilmrstw - node-10
192.168.0.20 cdfhilmrstw * node-20
192.168.0.30 cdfhilmrstw - node-30
192.168.0.99 il - node-99
Run Code Online (Sandbox Code Playgroud)
并且 Elasticsearch 已选择node-20作为活动主节点,您可以运行以下调用来从投票中删除活动节点。
POST /_cluster/voting_config_exclusions?node_names=node_name
Run Code Online (Sandbox Code Playgroud)
这将随机选择另一个符合主节点资格的节点作为主节点(如果您还有多个节点),请对活动节点继续执行此操作,直到将正确的节点激活为主节点。
注意:这不会删除节点,只会使其成为非活动主/非投票节点,并允许另一个节点成为活动主节点。
完成后,请确保运行以下命令以删除排除项,并在所选节点出现故障时允许所有符合条件的节点成为主节点。
DELETE /_cluster/voting_config_exclusions
Run Code Online (Sandbox Code Playgroud)
谢谢
| 归档时间: |
|
| 查看次数: |
14066 次 |
| 最近记录: |