下面我具體描述一下我遇到的問題。
在kibana上面創建索引點擊創建時,一直顯示下面的頁面
就看到不停的在那轉,始終創建不成功。
查看後臺日誌,看到狀態碼爲403,報瞭如下的錯誤
由於我用的是es6版本,所以懷疑是.kibana沒有寫入權限
我嘗試修改index.blocks.write
執行:
PUT .kibana/_settings { "index.blocks.write": true }
發現報了錯:
然後我開放了kibana關於elasticsearch的索引權限
執行成功:
然後,再次嘗試修改index.blocks.write
執行:
PUT .kibana/_settings { "index.blocks.write": true }
執行成功:
但最後發現還是這樣
着實搞得我頭大,最後終於在官網上找到了解決方法,具體參照下面這篇文章
https://www.elastic.co/guide/en/kibana/6.0/migrating-6.0-index.html
一共分爲四步:
第一步:設置.kibana的index.blocks.write屬性爲true
PUT .kibana/_settings { "index.blocks.write": true }
執行失敗可參照上面的解決方案
第二步:創建創建 .kibana-6
索引
PUT .kibana-6 { "settings" : { "number_of_shards" : 1, "index.mapper.dynamic": false }, "mappings" : { "doc": { "properties": { "type": { "type": "keyword" }, "updated_at": { "type": "date" }, "config": { "properties": { "buildNum": { "type": "keyword" } } }, "index-pattern": { "properties": { "fieldFormatMap": { "type": "text" }, "fields": { "type": "text" }, "intervalName": { "type": "keyword" }, "notExpandable": { "type": "boolean" }, "sourceFilters": { "type": "text" }, "timeFieldName": { "type": "keyword" }, "title": { "type": "text" } } }, "visualization": { "properties": { "description": { "type": "text" }, "kibanaSavedObjectMeta": { "properties": { "searchSourceJSON": { "type": "text" } } }, "savedSearchId": { "type": "keyword" }, "title": { "type": "text" }, "uiStateJSON": { "type": "text" }, "version": { "type": "integer" }, "visState": { "type": "text" } } }, "search": { "properties": { "columns": { "type": "keyword" }, "description": { "type": "text" }, "hits": { "type": "integer" }, "kibanaSavedObjectMeta": { "properties": { "searchSourceJSON": { "type": "text" } } }, "sort": { "type": "keyword" }, "title": { "type": "text" }, "version": { "type": "integer" } } }, "dashboard": { "properties": { "description": { "type": "text" }, "hits": { "type": "integer" }, "kibanaSavedObjectMeta": { "properties": { "searchSourceJSON": { "type": "text" } } }, "optionsJSON": { "type": "text" }, "panelsJSON": { "type": "text" }, "refreshInterval": { "properties": { "display": { "type": "keyword" }, "pause": { "type": "boolean" }, "section": { "type": "integer" }, "value": { "type": "integer" } } }, "timeFrom": { "type": "keyword" }, "timeRestore": { "type": "boolean" }, "timeTo": { "type": "keyword" }, "title": { "type": "text" }, "uiStateJSON": { "type": "text" }, "version": { "type": "integer" } } }, "url": { "properties": { "accessCount": { "type": "long" }, "accessDate": { "type": "date" }, "createDate": { "type": "date" }, "url": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 2048 } } } } }, "server": { "properties": { "uuid": { "type": "keyword" } } }, "timelion-sheet": { "properties": { "description": { "type": "text" }, "hits": { "type": "integer" }, "kibanaSavedObjectMeta": { "properties": { "searchSourceJSON": { "type": "text" } } }, "timelion_chart_height": { "type": "integer" }, "timelion_columns": { "type": "integer" }, "timelion_interval": { "type": "keyword" }, "timelion_other_interval": { "type": "keyword" }, "timelion_rows": { "type": "integer" }, "timelion_sheet": { "type": "text" }, "title": { "type": "text" }, "version": { "type": "integer" } } }, "graph-workspace": { "properties": { "description": { "type": "text" }, "kibanaSavedObjectMeta": { "properties": { "searchSourceJSON": { "type": "text" } } }, "numLinks": { "type": "integer" }, "numVertices": { "type": "integer" }, "title": { "type": "text" }, "version": { "type": "integer" }, "wsState": { "type": "text" } } } } } } }
第三步:Reindex .kibana
into .kibana-6
POST _reindex { "source": { "index": ".kibana" }, "dest": { "index": ".kibana-6" }, "script": { "inline": "ctx._source = [ ctx._type : ctx._source ]; ctx._source.type = ctx._type; ctx._id = ctx._type + \":\" + ctx._id; ctx._type = \"doc\"; ", "lang": "painless" } }
第四步:Alias .kibana-6
to .kibana
and remove legacy .kibana
index:
POST /_aliases { "actions" : [ { "add": { "index": ".kibana-6", "alias": ".kibana" } }, { "remove_index": { "index": ".kibana" } } ] }
最後問題解決,可以重新創建索引模式!!!
但是發現一個問題,就是這樣做,會丟失以前創建的所有模式。