我最近从Elasticsearch 1.5升级到Elasticsearch 5.5,我可以远程连接,但不能从本地主机连接。
我更新了elasticsearch.yml,以便能够远程连接:
network.host: 0.0.0.0而elasticsearch日志在我看来还不错:
[2017-11-05T22:44:23,441][INFO ][o.e.n.Node ] [node1] starting ...
[2017-11-05T22:44:23,655][INFO ][o.e.t.TransportService ] [node1] publish_address {[ip address]:9300}, bound_addresses {127.0.0.1:9300}, {[::1]:9300}, {[ip address]:9300}
[2017-11-05T22:44:23,666][INFO ][o.e.b.BootstrapChecks ] [node1] bound or publishing to a non-loopback or non-link-local address, enforcing bootstrap checks
[2017-11-05T22:44:26,712][INFO ][o.e.c.s.ClusterService ] [node1] new_master {node1}{s-J7aStjQFuwor-WY6bSCQ}{nv4GVIQ6SwScPiebRHBQBQ}{localhost}{[ip address]:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-11-05T22:44:26,733][INFO ][o.e.h.n.Netty4HttpServerTransport] [node1] publish_address {[ip address]:9200}, bound_addresses {127.0.0.1:9200}, {[::1]:9200}, {[ip address]:9200}
[2017-11-05T22:44:26,734][INFO ][o.e.n.Node ] [node1] started我想知道它是否与代理有关,因为当我尝试运行curl localhost:9200时,我得到了以下结果:
...
<p>The following error was encountered while trying to retrieve the URL: <a href="http://localhost:9200/">http://localhost:9200/</a></p>
<blockquote id="error">
<p><b>Connection to 127.0.0.1 failed.</b></p>
</blockquote>
<p id="sysmsg">The system returned: <i>(111) Connection refused</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
...任何关于如何缩小问题范围的想法或提示都将是有帮助的。
发布于 2017-11-07 04:11:19
结果是设置了一个代理所有出站流量的http_proxy bash变量。取消设置此变量后,curl命令即可工作。
事实证明,在这个修复之前,我意识到我们的Java应用程序仍然能够本地连接到Elasticsearch,只是curl命令不起作用。
https://stackoverflow.com/questions/47129703
复制相似问题