我刚刚通过APT遵循Elasticsearch安装指南: https : //www.elastic.co/guide/en/elasticsearch/reference/5.0/deb.html
当我运行curl -X GET 'http://127.0.0.1:9200/' : Failed to connect to 127.0.0.1 port 9200: Connection refused curl -X GET 'http://127.0.0.1:9200/' (或localhost)时,我收到一个错误: Failed to connect to 127.0.0.1 port 9200: Connection refused
在我的configuration中,我正在使用:
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 /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'. ...
我怎样才能在网上获得这项服务?
撤消configuration更改,服务应该开始:
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。