kibana添加index pattern卡住,通过浏览器查看请求返回状态为403 Forbidden,返回消息为:
通过curl模拟请求响应如下:
# curl -XPOST -H 'Content-Type: application/json' -H 'kbn-version: 6.6.0' http://kibana_server:5600/api/saved_objects/index-pattern -d '{"attributes": {"title": "index-prefix-*", "timeFieldName": "@timestamp"}}'
{"message":"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];: [cluster_block_exception] blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];","statusCode":403,"error":"Forbidden"}
解决方法:设置es索引参数
# curl -XPUT -H 'Content-Type: application/json' http://es_server:9200/_settings -d '
{
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}'
# curl -XPUT -H 'Content-Type: application/json' http://es_server:9200/$index_name/_settings -d '
{
"index": {
"blocks": {
"read_only_allow_delete": "false"
}
}
}'