创建master + data和client + data的单独elasticsearch节点

时间:2014-06-17 22:29:39

标签: configuration elasticsearch

我们目前拥有一个强大的12节点集群,其中所有节点都是主要资格,客户端和数据。 最近我们遇到了一个裂脑问题,主人没有反应太久,另一个节点选出了自己。尽管所有节点都已启动且minimum_master_nodes设置为7(新主节点可以看到其他10个符合条件的节点)。 我们希望通过将3个节点设置为主要合格而将其他9个节点设置为客户端来降低风险,而所有12个节点都是数据节点。 我原以为我们可以设置:

node.master: true
node.client: false
node.data: true

在3个节点上,并且:

node.master: false
node.client: true
node.data: true

另一方面9。 结果导致:

"org.elasticsearch.ElasticsearchIllegalStateException: node is not configured to store local location" 

我一直在寻找无济于事。有没有正确的方法来实现这个目标?

1 个答案:

答案 0 :(得分:22)

我跳过使用node.client - 它实际上与你的node.data设置冲突,这就是导致错误信息的原因。它也不是必需的。

您只需要node.master和node.data。如果两者都为真(默认值),则它既是数据节点又是主节点。如果master为false且数据为true,则它是仅数据节点。如果master为true且data为false,则它是仅主节点。如果两者都是假的,那么它就是客户端节点。

从版本1.2.1的当前默认elasticsearch.yml文件:

# You can exploit these settings to design advanced cluster topologies.
#
# 1. You want this node to never become a master node, only to hold data.
#    This will be the "workhorse" of your cluster.
#
#node.master: false
#node.data: true
#
# 2. You want this node to only serve as a master: to not store any data and
#    to have free resources. This will be the "coordinator" of your cluster.
#
#node.master: true
#node.data: false
#
# 3. You want this node to be neither master nor data node, but
#    to act as a "search load balancer" (fetching data from nodes,
#    aggregating results, etc.)
#
#node.master: false
#node.data: false