Kibana 无法连接到 windows 上的 elasticsearch

Kibana unabe to connect to elasticsearch on windows

我是 运行 elastic search 7.6,它在 http://localhost:9200/ 上工作正常。我可以使用 REST API 向索引添加值。

现在当我启动 kibana 7.6 时,出现以下错误:-

log   [12:31:32.247] [info][plugins-service] Plugin "case" is disabled.
  log   [12:31:44.432] [info][plugins-system] Setting up [36] plugins: [taskManager,siem,licensing,infra,encryptedSavedObjects,code,timelion,features,security,usageCollection,metrics,canvas,apm_oss,translations,reporting,status_page,share,uiActions,data,navigation,newsfeed,kibana_legacy,management,dev_tools,home,spaces,cloud,graph,inspector,expressions,visualizations,embeddable,advancedUiActions,dashboard_embeddable_container,eui_utils,bfetch]                                   log   [12:31:44.435] [info]
  log   [12:31:44.587] [info][savedobjects-service] Waiting until all Elasticsearch nodes are compatible with Kibana before starting saved objects migrations...
  log   [12:31:44.617] [info][savedobjects-service] Starting saved objects migrations                                     log   [12:31:44.657] [info][savedobjects-service] Creating index .kibana_1.
  log   [12:31:44.663] [info][savedobjects-service] Creating index .kibana_task_manager_1. 
  log   [12:32:14.663] [warning][savedobjects-service] Unable to connect to Elasticsearch. Error: Request Timeout after 30000ms

Unable to connect to Elasticsearch. Error: Request Timeout after 30000ms

我遇到了和你一样的问题,我通过将 cmd prompt window 切换为 PowerShell window 来解决它。看来command prompt window 很敏感。你可能会在这里得到一些想法。 https://discuss.elastic.co/t/kibana-7-4-0-on-windows-command-prompt-not-able-to-start/203877/7

顺便说一句,如果您在重启 Kibana 时收到警告,例如:

  log   [06:27:47.136] [warning][savedobjects-service] Unable to connect to Elasticsearch. Error: [resource_already_exists_exception] index [.kibana_task_manager_1/EmPx77s1TLWbLQdqQ8iC0w] already exists, with { index_uuid="EmPx77s1TLWbLQdqQ8iC0w" & index=".kibana_task_manager_1" }
  log   [06:27:47.140] [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_task_manager_1 and restarting Kibana.

按照它告诉你的去做,删除索引 .kibana_task_manager_1 并重新启动 Kibana。

curl -XDELETE http://localhost:9200/.kibana_task_manager_1

祝你好运。