ticsearch中的Master节点网关和其他节点网关有什么区

ticsearch中的Master节点网关和其他节点网关有什么区

本文介绍了elasticsearch中的Master节点网关和其他节点网关有什么区别?它们都存储元数据,不是吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

elasticsearch 中的 Master 节点网关和其他节点网关有什么区别?它们都存储元数据,不是吗?元数据,调用elasticsearch,我们可以从中得到什么信息?

What different between Master node gateway and other node gateway in elasticsearch? Both of them store meta data, isn't it?Meta data, elasticsearch called, what information we can get from it?

推荐答案

master 节点与集群中的任何其他节点相同,只是它已被选为 master.

The master node is the same as any other node in the cluster, except that it has been elected to be the master.

它负责协调任何集群范围的更改,例如添加或删除节点,创建、删除或更改索引的状态(即打开/关闭),以及向节点分配分片.当这些变化中的任何一个发生时,集群状态"由主节点更新并发布到集群中的所有其他节点.它是唯一可以发布新集群状态的节点.

It is responsible for coordinating any cluster-wide changes, such as the addition or removal of a node, creation, deletion or change of state (i.e. open/close) of an index, and the allocation of shards to nodes. When any of these changes occur, the "cluster state" is updated by the master and published to all other nodes in the cluster. It is the only node that may publish a new cluster state.

master 执行的任务是轻量级的.任何处理数据的任务(例如索引、搜索等)都不需要涉及 master.如果您选择将 master 作为非数据节点运行(即作为 master 和路由器的节点,但不包含任何数据),那么 master 可以在一个小盒子上愉快地运行.

The tasks that a master performs are lightweight. Any tasks that deal with data (eg indexing, searching etc) do not need to involve the master. If you choose to run the master as a non-data node (ie a node that acts as master and as a router, but doesn't contain any data) then the master can run happily on a smallish box.

如果一个节点被标记为符合主节点"(默认情况下所有节点都是这样),它就可以成为主节点.如果当前的master宕机,集群会选举一个新的master.

A node is allowed to become a master if it is marked as "master eligible" (which all nodes are by default). If the current master goes down, a new master will be elected by the cluster.

集群中的一个重要配置选项是minimum_master_nodes.这指定了节点必须能够看到才能成为集群的一部分的符合主节点的"节点的数量.其目的是避免脑裂",即让集群分成两个集群,而这两个集群都认为它们运行正常.

An important configuration option in your cluster is minimum_master_nodes. This specifies the number of "master eligible" nodes that a node must be able to see in order to be part of a cluster. Its purpose is to avoid "split brain" ie having the cluster separate into two clusters, both of which think that they are functioning correctly.

比如,如果你有3个节点,所有节点都是master,并且设置minimum_master_nodes为1,那么如果第三个节点和另外两个分开了,它仍然看到一个master-符合条件的节点(自身),认为自己可以形成集群.

For instance, if you have 3 nodes, all of which are master eligible, and set minimum_master_nodes to 1, then if the third node is separated from the other two it, it still sees one master-eligible node (itself) and thinks that it can form a cluster by itself.

相反,在这种情况下将 minimum_master_nodes 设置为 2(节点数/2 + 1),那么如果第三个节点分离,它将看不到足够的主节点,因此不会自己形成一个集群.它将继续尝试加入原始集群.

Instead, set minimum_master_nodes to 2 in this case (number of nodes / 2 + 1), then if the third node separates, it won't see enough master nodes, and thus won't form a cluster by itself. It will keep trying to join the original cluster.

虽然 Elasticsearch 非常努力地选择正确的默认值,但 minimum_master_nodes 是无法猜测的,因为它无法知道您打算运行多少个节点.这是您必须自己配置的内容.

While Elasticsearch tries very hard to choose the correct defaults, minimum_master_nodes is impossible to guess, as it has no way of knowing how many nodes you intend to run. This is something you must configure yourself.

这篇关于elasticsearch中的Master节点网关和其他节点网关有什么区别?它们都存储元数据,不是吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 17:23