問題描述
在啟動 Kibana 時,日誌如下:
./kibana
log [06:40:49.881] [info][plugins-service] Plugin "case" is disabled.
log [06:40:55.314] [info][plugins-system] Setting up [37] plugins: [taskManager,siem,licensing,infra,encryptedSavedObjects,code,usageCollection,metrics,canvas,timelion,features,security,apm_oss,translations,reporting,uiActions,data,navigation,share,status_page,inspector,expressions,visualizations,embeddable,advancedUiActions,dashboard_embeddable_container,newsfeed,kibana_legacy,management,dev_tools,home,spaces,cloud,apm,graph,eui_utils,bfetch]
log [06:40:55.316] [info][plugins][taskManager] Setting up plugin
log [06:40:55.332] [info][plugins][siem] Setting up plugin
log [06:40:55.332] [info][licensing][plugins] Setting up plugin
log [06:40:55.335] [info][infra][plugins] Setting up plugin
log [06:40:55.335] [info][encryptedSavedObjects][plugins] Setting up plugin
log [06:40:55.336] [warning][config][encryptedSavedObjects][plugins] Generating a random key for xpack.encryptedSavedObjects.encryptionKey. To be able to decrypt encrypted saved objects attributes after restart, please set xpack.encryptedSavedObjects.encryptionKey in kibana.yml
log [06:40:55.340] [info][code][plugins] Setting up plugin
log [06:40:55.341] [info][plugins][usageCollection] Setting up plugin
log [06:40:55.342] [info][metrics][plugins] Setting up plugin
log [06:40:55.343] [info][canvas][plugins] Setting up plugin
log [06:40:55.349] [info][plugins][timelion] Setting up plugin
log [06:40:55.350] [info][features][plugins] Setting up plugin
log [06:40:55.351] [info][plugins][security] Setting up plugin
log [06:40:55.352] [warning][config][plugins][security] Generating a random key for xpack.security.encryptionKey. To prevent sessions from being invalidated on restart, please set xpack.security.encryptionKey in kibana.yml
log [06:40:55.353] [warning][config][plugins][security] Session cookies will be transmitted over insecure connections. This is not recommended.
log [06:40:55.371] [info][apm_oss][plugins] Setting up plugin
log [06:40:55.371] [info][plugins][translations] Setting up plugin
log [06:40:55.372] [info][data][plugins] Setting up plugin
log [06:40:55.378] [info][plugins][share] Setting up plugin
log [06:40:55.379] [info][home][plugins] Setting up plugin
log [06:40:55.383] [info][plugins][spaces] Setting up plugin
log [06:40:55.387] [info][cloud][plugins] Setting up plugin
log [06:40:55.387] [info][apm][plugins] Setting up plugin
log [06:40:55.391] [info][graph][plugins] Setting up plugin
log [06:40:55.395] [info][bfetch][plugins] Setting up plugin
log [06:40:55.404] [info][savedobjects-service] Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations...
log [06:40:55.423] [info][savedobjects-service] Starting saved objects migrations
log [06:40:55.455] [info][savedobjects-service] Creating index .kibana_2.
log [06:40:55.463] [warning][savedobjects-service] Unable to connect to Elasticsearch. Error: [resource_already_exists_exception] index [.kibana_2/kFVxpf8ERHa37HcqryX9FA] already exists, with { index_uuid="kFVxpf8ERHa37HcqryX9FA" & index=".kibana_2" }
log [06:40:55.464] [warning][savedobjects-service] Another Kibana instance appears to be migrating the index. Waiting for that migration to complete. If no other Kibana instance is attempting migrations, you can get past this message by deleting index .kibana_2 and restarting Kibana.
此時開啟 http://localhost:5601/
,報如下錯誤資訊,
Kibana server is not ready yet
解決方案
網上有各種各樣的解決方案,但是都不太適用。檢視一下錯誤日誌,發現有如下錯誤日誌:
log [06:40:55.464] [warning][savedobjects-service] Another Kibana instance appears to be migrating the index. Waiting for that migration to complete. If no other Kibana instance is attempting migrations, you can get past this message by deleting index .kibana_2 and restarting Kibana.
利用 elasticsearch-head
外掛去檢視一下索引,發現果然有 .kibana_2
索引,並且還有其他以 .kibana
開頭的索引,將這些索引都刪除了。
重新執行啟動命令 ./kibana
。
Kibana 正常執行。
小結
導致上述問題的原因可能千奇百怪,各種方法都驗證一下,直到找到自己的解決方案。
本作品採用《CC 協議》,轉載必須註明作者和本文連結