AWS Elasticsearch集群块例外:SERVICE_UNAVAILABLE / 2 / no_master

时间:2017-06-02 07:38:37

标签: amazon-web-services elasticsearch

关于问题

我们正在使用AWS Elasticsearch Service来托管我们的弹性搜索群集。

我们在自己的服务器上托管了一个外部系统,该系统不在云端。 该系统每隔几个小时就会将新数据推送到集群中。

有几次我们在这个外部系统中遇到异常。我们正在使用official elasticsearch php client与群集进行通信。 导入期间抛出Elasticsearch\Common\Exceptions\ServerErrorResponseException。这种情况每周只发生5-7次。 同时,我们在ec2实例上的应用程序的读取请求正常工作。没有例外。

我们正在使用多个批量请求来尽可能高效地导入新数据。每个批量请求包含1000个只有6个字段的小文档。 每个字段中最长的文本长度约为40个字符。

错误

外部系统的例外:

{
  "error": {
    "root_cause": [
      {
        "type": "cluster_block_exception",
        "reason": "blocked by: [SERVICE_UNAVAILABLE/2/no master];"
      }
    ],
    "type": "cluster_block_exception",
    "reason": "blocked by: [SERVICE_UNAVAILABLE/2/no master];"
  },
  "status": 503
}

首次配置

我们的第一个弹性搜索域配置包含3个数据节点且没有专用主节点:

Elasticsearch Version: 5.1
Status: Green
Number of nodes: 3
Number of data nodes: 3
Active primary shards: 2
Active shards: 5
Relocating shards: 0
Initializing shards: 0
Unassigned shards: 0
Instance count: 3
Enable dedicated master: yes
Dedicated master instance count: 3
Enable zone awareness: no

EBS volume size per instance: 30 GB
Total cluster size: 90 GB
Used size: about 4.3 GB

当前配置

AWS建议使用专用主节点。所以我们将这样的域配置调整为3个数据和3个主节点。这是我们目前的配置:

Elasticsearch Version: 5.1
Status: Green
Number of nodes: 6
Number of data nodes: 3
Active primary shards: 2
Active shards: 5
Relocating shards: 0
Initializing shards: 0
Unassigned shards: 0
Instance count: 3
Enable dedicated master: yes
Dedicated master instance count: 3
Enable zone awareness: no

EBS volume size per instance: 30 GB
Total cluster size: 90 GB
Used size: about 4.3 GB

但是有时仍会抛出异常并且错误率没有改变。

我的想法

我考虑过启用zone awareness设置。也许可用区有问题?但这只有在我们使用偶数个实例的情况下才有可能 如果发生裂脑,我不确定在这种情况下集群是如何工作的。

TLDR

为什么elasticsearch会随机告诉我,当我有三个专用主节点时,它找不到主节点?

0 个答案:

没有答案
相关问题