ES中已经有索引了。我使用 ElasticSearch-PHP 作为客户端。根据ES 文档, 这些代码应该更改 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}
我该如何解决?先感谢您。