大叔经验分享(45)kibana添加index pattern卡住 返回403 Forbidden

 

kibana添加index pattern卡住,通过浏览器查看请求返回状态为403 Forbidden,返回消息为:

{"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"}

通过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"
        }
    }
}'

 

posted @ 2019-03-29 17:55  匠人先生  阅读(4202)  评论(0编辑  收藏  举报