gpt4 book ai didi

elasticsearch - ES 可从 curl 访问但不能从 Marvel/Sense 访问

转载 作者:行者123 更新时间:2023-11-29 02:44:41 42 4
gpt4 key购买 nike

我沉浸在 Elastic Search 中的 2 个小时。我用 Marvel 成功安装了 ES(在 config/elasticsearch.yml 中使用 marvel.agent.enabled: false)并且能够从 Sense 发出成功的请求。我重新启动了我的开发机器,现在当我在 Sense 上发出以下请求时,它会响应:

Request failed to get to the server (status code: 0):

Elasticsearch may not be reachable or you may need to check your CORS settings.If CORS is enabled, try turning off Sense's Basic Authentication support under Setting (cog icon).This will result in a less strict CORS enforcement by the browser.
Please check the marvel documentation for more information.

请求(source):

PUT /megacorp/employee/1
{
"first_name" : "John",
"last_name" : "Smith",
"age" : 25,
"about" : "I love to go rock climbing",
"interests": [ "sports", "music" ]
}

按照指示,我通过在 curl 上发出类似的请求来检查是否可以访问 ES:

要求:

curl -XPUT http://localhost:9200/megacorp/employee/100 -d '{ "first_name" : "test" }'

响应:

{"_index":"megacorp","_type":"employee","_id":"100","_version":1,"created":true}

这让我认为 ES 是可用的。

继续进行下一个检查“您可能需要检查您的 CORS 设置。”。我根据this recommendation在elasticsearch.yml中添加了如下配置(并重启了ES) :

http.cors.enabled: true
http.cors.allow-origin: /.*/
http.cors.allow-credentials: true

但是行为没有变化。

在 Marvel/Smart 设置中切换“支持基本身份验证”也没有任何影响。

欢迎就可能出现的问题提出任何建议。

最佳答案

尝试在另一个浏览器或隐私/隐身模式下运行 marvel/sense html 页面。我有同样的问题,这样做解决了它。我认为这是由于设置存储在 cookie 上或不太确定的原因。

关于elasticsearch - ES 可从 curl 访问但不能从 Marvel/Sense 访问,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28354523/

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