Elasticsearch集群中的一个节点永久超载

问题描述:

我有一个包含11个节点的Elasticsearch集群。其中五个是数据节点,另一个是我添加和检索文档的客户端节点。Elasticsearch集群中的一个节点永久超载

我正在使用标准的Elasticsearch配置。每个索引有5个分片和副本。在集群中,我有55个索引和大约150GB的数据。

该集群非常缓慢。通过Kopf插件,我可以看到每个节点的统计信息。在那里我可以看到单个数据节点(不是主节点)永久超载。堆,磁盘,CPU都可以,但几乎每次都是100%。我注意到,每个分片都是主分片,而所有其他数据节点都有主分片和副本。当我关闭该节点然后再打开时,另一个数据节点上会发生同样的问题。

我不知道为什么以及如何解决这个问题。我认为客户端节点和主节点均匀分配请求?为什么总是有一个数据节点重载?

请尝试以下设置:

cluster.routing.rebalance.enable

启用或特定种类的碎片禁用再平衡:

all - (default) Allows shard balancing for all kinds of shards. 
    primaries - Allows shard balancing only for primary shards. 
    replicas - Allows shard balancing only for replica shards. 
    none - No shard balancing of any kind are allowed for any indices. 

cluster.routing.allocation .allow_rebalance

指定何时RD再平衡是可以的:

always - Always allow rebalancing. 
    indices_primaries_active - Only when all primaries in the cluster are allocated. 
    indices_all_active - (default) Only when all shards (primaries and replicas) in the cluster are allocated. 

cluster.routing.allocation.cluster_concurrent_rebalance

允许控制并发碎片重新平衡数量上限是多少集群宽。

Defaults to 2 

样品卷曲应用所需的设置:

curl -XPUT <elasticsearchserver>:9200/_cluster/settings -d '{ 
    "transient" : { 
    "cluster.routing.rebalance.enable" : "all" 
    } 
} 

您可以替换transientpersistent如果你希望你的设置重新启动整个坚持。

+0

我必须将此设置添加到所有节点上的elasticsearch.yml文件吗? – CPA

+0

您可以通过'PUT/_cluster/settings'端点在线执行此操作 –