Kibana7.1.1及之前的版本创建索引模式失败Create index pattern

1 问题描述:Kibana7.1.1及之前版本创建索引模式Create index pattern,页面显示创建成功,实际未能保存pattern,discover无法使用可视化查询

启动时错误提示:
error [06:18:45.800] [warning][stats-collection] [illegal_argument_exception] Fielddata is disabled on text fields by default. Set fielddata=true on [type] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead. :: {"path":"/.kibana/_search","query":{"ignore_unavailable":true,"filter_path":"aggregations.types.buckets"},"body":"{\"size\":0,\"query\":{\"terms\":{\"type\":[\"dashboard\",\"visualization\",\"search\",\"index-pattern\",\"graph-workspace\",\"timelion-sheet\"]}},\"aggs\":{\"types\":{\"terms\":{\"field\":\"type\",\"size\":6}}}}","statusCode":400,"response":"{\"error\":{\"root_cause\":[{\"type\":\"illegal_argument_exception\",\"reason\":\"Fielddata is disabled on text fields by default. Set fielddata=true on [type] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.\"}],\"type\":\"search_phase_execution_exception\",\"reason\":\"all shards failed\",\"phase\":\"query\",\"grouped\":true,\"failed_shards\":[{\"shard\":0,\"index\":\".kibana\",\"node\":\"T-3hriZzRrelQJ12NHbRng\",\"reason\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Fielddata is disabled on text fields by default. Set fielddata=true on [type] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.\"}}],\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Fielddata is disabled on text fields by default. Set fielddata=true on [type] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.\",\"caused_by\":{\"type\":\"illegal_argument_exception\",\"reason\":\"Fielddata is disabled on text fields by default. Set fielddata=true on [type] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.\"}}},\"status\":400}"}

    at respond (/usr/local/kibana/kibana-7.1.1-linux-x86_64/node_modules/elasticsearch/src/lib/transport.js:308:15)

    at checkRespForFailure (/usr/local/kibana/kibana-7.1.1-linux-x86_64/node_modules/elasticsearch/src/lib/transport.js:267:7)

    at HttpConnector.<anonymous> (/usr/local/kibana/kibana-7.1.1-linux-x86_64/node_modules/elasticsearch/src/lib/connectors/http.js:166:7)

    at IncomingMessage.wrapper (/usr/local/kibana/kibana-7.1.1-linux-x86_64/node_modules/elasticsearch/node_modules/lodash/lodash.js:4935:19)

    at IncomingMessage.emit (events.js:194:15)

    at endReadableNT (_stream_readable.js:1103:12)

    at process._tickCallback (internal/process/next_tick.js:63:19)

  log  [06:18:45.801] [warning][stats-collection] Unable to fetch data from kibana collector

本图是已经解决问题后截图

2 经官网论坛和GitHub查找发现,报错原因:

After clean install and loading documents with logstash the index itself exists.

Kibana重复请求索引模式,而es日志给出字段数据错误


3 解决方法:

1)delete the kibana index

2)recreate it with the correct mapping

PUT /.kibana

{                                                           

    "aliases": {},

    "mappings": {

      "properties": {

        "config": {

          "properties": {

            "buildNum": {

              "type": "long"

            }

          }

        },

        "index-pattern": {

          "properties": {

            "fields": {

              "type": "text",

              "fields": {

                "keyword": {

                  "type": "keyword",

                  "ignore_above": 256

                }

              }

            },

            "timeFieldName": {

              "type": "text",

              "fields": {

                "keyword": {

                  "type": "keyword",

                  "ignore_above": 256

                }

              }

            },

            "title": {

              "type": "text",

              "fields": {

                "keyword": {

                  "type": "keyword",

                  "ignore_above": 256

                }

              }

            }

          }

        },

        "type": {

          "type": "keyword",

          "fields": {

            "keyword": {

              "type": "keyword",

              "ignore_above": 256

            }

          }

        },

        "updated_at": {

          "type": "date"

        }

      }

    },

    "settings": {

      "index": {

        "number_of_shards": "5",

        "number_of_replicas": "1"

      }

    }

}

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容