gpt4 book ai didi

elasticsearch - elasticsearch-无法通过curl访问localhost:9200

转载 作者:行者123 更新时间:2023-12-02 23:59:11 25 4
gpt4 key购买 nike

我启动elasticsearch服务器,并希望通过curl访问localhost:9200

这是我的尝试:
curl -u elastic:H5VzhJP0txg4Lm9EMSZp localhost:9200curl -u elastic:H5VzhJP0txg4Lm9EMSZp http://localhost:9200curl -u elastic:H5VzhJP0txg4Lm9EMSZp http://127.0.0.1:9200curl -XGET -u elastic:H5VzhJP0txg4Lm9EMSZp http://localhost:9200curl -XGET -u elastic:H5VzhJP0txg4Lm9EMSZp -H 'Content-Type: application/json' 'http://localhost:9200'
他们全都给我结果:curl: (52) Empty reply from server
但是,我可以通过浏览器访问localhost:9200

这是我的elasticsearch版本:

☁  kibana-research [master] ⚡  elasticsearch --version
Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file logs/gc.log due to No such file or directory

Version: 6.2.4, Build: ccec39f/2018-04-12T20:37:28.497551Z, JVM: 1.8.0_171

最佳答案

我认为原因是proxy
这是我在~/.zshrc文件中的配置

 98 # proxy list
99 alias proxy='export all_proxy=socks5://127.0.0.1:1086'
100 alias unproxy='unset all_proxy'

当我在终端中运行 unproxy时,这意味着我不使用代理服务器。

然后,它工作正常。
☁  kibana-research [master] ⚡  curl -u elastic:H5VzhJP0txg4Lm9EMSZp localhost:9200
{
"name" : "KBgeNNv",
"cluster_name" : "elasticsearch_ldu020",
"cluster_uuid" : "Src22ahwTYy9jVthB8w0DQ",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

关于elasticsearch - elasticsearch-无法通过curl访问localhost:9200,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50638174/

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