(AWS Linux) Failed to connect to localhost port 9200: Connection refused

I am unable to start my elasticsearch service successfully despite a correctly configured elasticsearch.yml file. I have only uncommented one line and edited it.

network.host: "localhost"

I start my service with sudo service elasticsearch start and I attempt to curl to http://localhost:9200. I then received a message saying curl: (7) Failed to connect to localhost port 9200: Connection refused. This is what I see in systemctl status elasticsearch

● elasticsearch.service - Elasticsearch
Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-07-17 07:41:22 UTC; 2s ago
Docs: http://www.elastic.co
Process: 2988 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
Main PID: 2988 (code=exited, status=1/FAILURE)

Jul 17 07:41:22 ip-172-31-32-121 elasticsearch[2988]: at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
Jul 17 07:41:22 ip-172-31-32-121 elasticsearch[2988]: at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
Jul 17 07:41:22 ip-172-31-32-121 elasticsearch[2988]: at java.nio.file.Files.newByteChannel(Files.java:361)
Jul 17 07:41:22 ip-172-31-32-121 elasticsearch[2988]: at java.nio.file.Files.newByteChannel(Files.java:407)
Jul 17 07:41:22 ip-172-31-32-121 elasticsearch[2988]: at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384)
Jul 17 07:41:22 ip-172-31-32-121 elasticsearch[2988]: at java.nio.file.Files.newInputStream(Files.java:152)
Jul 17 07:41:22 ip-172-31-32-121 elasticsearch[2988]: at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:58)
Jul 17 07:41:22 ip-172-31-32-121 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Jul 17 07:41:22 ip-172-31-32-121 systemd[1]: elasticsearch.service: Unit entered failed state.
Jul 17 07:41:22 ip-172-31-32-121 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

Was your node every running successfully or was this a first attempt? Could you share your logs for Elasticsearch please? Should be located in /var/log/elasticsearch

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.