gpt4 book ai didi

elasticsearch - ElasticHQ : Unable to Connect to Server! 收到状态码:0

转载 作者:行者123 更新时间:2023-11-29 02:43:54 26 4
gpt4 key购买 nike

当我尝试连接到 Elastic HQ 时出现以下错误。 elasticsearch 的本地实例正在运行。 Elasticsearch 版本为2.0.0。

在 elasticsearch.yml 中,http.cors.enabled:设置为 true

收到以下错误:

ElasticHQ:无法连接到服务器!收到的状态代码:0。状态代码为 0,可能意味着主机无法访问或没有任何内容在给定端口上监听。您是否启用了 CORS?

我错过了什么吗?

Elasticsearch 配置

    # ---------------------------------- Network -----------------------------------
#
# Set the bind adress to a specific IP (IPv4 or IPv6):
#
network.host: 127.0.0.1
#
# Set a custom port for HTTP:
#
http.port: 9200

http.cors.enabled: true

浏览器控制台消息

The browser console says 

Inside ErrorMessage
all.min.js:12 http://127.0.0.1:9200
all.min.js:12 Inside ClusterHealth
all.min.js:12 Inside ClusterState
all.min.js:12 Inside IndexStatsModel
all.min.js:12 Inside NodeList
index.html:1 XMLHttpRequest cannot load http://127.0.0.1:9200/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
all.min.js:12 Failed to Connect on Ping!

最佳答案

现在可以使用了!我必须在 elasticsearch.yml 中添加另一个条目

http.cors.allow-origin: "*"
http.cors.enabled: true
node.master: true

关于elasticsearch - ElasticHQ : Unable to Connect to Server! 收到状态码:0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33722127/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com