我刚刚通过APT:https://www.elastic.co/guide/en/elasticsearch/reference/5.0/deb.html遵循了Elasticsearch的安装指南
当我运行curl -X GET 'http://127.0.0.1:9200/'
(或本地主机)时,会收到一个错误:Failed to connect to 127.0.0.1 port 9200: Connection refused
在我的配置中,我使用:
network.bind_host: localhost
network.publish_host: 0.0.0.0
network.host: 0.0.0.0
http.port: 9200
我在/var/log/elasticsearch/
的日志是空白的,但是看看sudo journalctl --unit elasticsearch
,我看到了:
Starting Elasticsearch...
Started Elasticsearch.
elasticsearch.service: Main process exited, code=killed, status=9/KILL
elasticsearch.service: Unit entered failed state.
elasticsearch.service: Failed with result 'signal'.
Starting Elasticsearch...
Started Elasticsearch.
elasticsearch.service: Main process exited, code=killed, status=9/KILL
elasticsearch.service: Unit entered failed state.
elasticsearch.service: Failed with result 'signal'.
Starting Elasticsearch...
Started Elasticsearch.
elasticsearch.service: Main process exited, code=killed, status=9/KILL
elasticsearch.service: Unit entered failed state.
elasticsearch.service: Failed with result 'signal'.
...
我怎样才能追踪到在网上获得这项服务的原因呢?
发布于 2017-02-21 21:51:56
撤消您的配置更改和服务应该启动:
bind_host
默认为network.host
(在您的示例中是0.0.0.0
),但您却强制使用localhost
?(0.0.0.0 != localhost)network.host
-出于安全原因,我不会设置为0.0.0.0
(默认值:127.0.0.1
)http.port
-设置为9200。https://serverfault.com/questions/834035
复制相似问题