【问题标题】:Cannot update ES settings using ElasticSearch-PHP无法使用 ElasticSearch-PHP 更新 ES 设置
【发布时间】:2019-05-24 03:04:57
【问题描述】:

ES 中已经有一个索引。我使用 ElasticSearch-PHP 作为客户端。 根据ES docs,这些代码应该更改 ES 设置:

$params = [
   'index' => 'my_index',
   'body' => [
      'settings' => [
         'number_of_replicas' => 0,
         'refresh_interval' => -1
       ]
    ]
];

$response = $client->indices()->putSettings($params);

但运行代码后会显示此错误:

**Fatal error** : Uncaught exception 'Elasticsearch\Common\Exceptions\Forbidden403Exception' with message '{"error":{"root_cause":[{"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"}],"type":"cluster_block_exception","reason":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"},"status":403}

我该如何解决? 提前谢谢你。

【问题讨论】:

    标签: elasticsearch elasticsearch-php


    【解决方案1】:

    您的 elasticsearch 服务器主机可能存储空间不足。 在 Kibana 开发工具中运行以下命令。至少应该暂时解决这个问题。

    PUT .kibana/_settings
    {
      "index": {
        "blocks": {
          "read_only_allow_delete": "false"
        }
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2015-12-08
      • 2021-01-15
      • 1970-01-01
      • 2016-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多