Connection refused after installing new version of elasticsearch



I have a cluster consisting of twelve nodes (CentOS 7). It had ES 2.3.0 and I wanted to upgrade it to 2.4.0. I followed the rolling upgrades instructions for each node and thought it all went well. But if I did a curl localhost:9200 then I saw it was still using ES 2.3.0 instead of the new one.

So I did a yum remove elasticsearch on all nodes and then installed the latest version of elasticsearch. Updated the elasticsearch.yml files (clustername, nodename, netwerkhost, unicast nodes) and did a systemctl daemon-reload and then a service elasticsearch restart on all nodes. Then I tried on the master node a curl localhost:9200 but now it says:

curl: (7) Failed connect to localhost:9200; Connection refused.

I also tried this command which I've found after googling but it did not help: sudo chown -R elasticsearch:elasticsearch /var/lib/elasticsearch/

I have no idea why I can't get the cluster up and running and I have a gut feeling that I did not do logical things but I hope you guys can point me in the right direction.

(Magnus B├Ąck) #2

It seems like ES isn't starting up. Check its logs.


I'm in /var/log/elasticsearch but I cannot find the log of today when it all happened. There is not one with the current date. The elasticsearch.log does not have any useful info. Any other ideas?

If I try to start ES manually:

Exception in thread "main" ElasticsearchException[Failed to load logging configuration]; nested: NoSuchFileException[/usr/share/elasticsearch/config];
Likely root cause: java.nio.file.NoSuchFileException: /usr/share/elasticsearch/config
at sun.nio.fs.UnixException.translateToIOException(
at sun.nio.fs.UnixException.rethrowAsIOException(
at sun.nio.fs.UnixException.rethrowAsIOException(
at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(
at sun.nio.fs.UnixFileSystemProvider.readAttributes(
at sun.nio.fs.LinuxFileSystemProvider.readAttributes(
at java.nio.file.Files.readAttributes(
at java.nio.file.FileTreeWalker.getAttributes(
at java.nio.file.FileTreeWalker.visit(
at java.nio.file.FileTreeWalker.walk(
at java.nio.file.Files.walkFileTree(
at org.elasticsearch.common.logging.log4j.LogConfigurator.resolveConfig(
at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(
at org.elasticsearch.bootstrap.Bootstrap.init(
at org.elasticsearch.bootstrap.Elasticsearch.main(
Refer to the log for complete error details.

(Nik Everett) #4

I think CentOS7 is systemd. Check out systemd's logs and see if it has anything.

If that doesn't work then I'd try to run Elasticsearch as the Elasticsearch user and see what it does.


I did not properly start elasticsearch. I used this command: sudo service elasticsearch start and I got it up and running. I tried 'systemctl elasticsearch start' the whole time but it did not work. Sorry, pretty lame from myself for not trying the suggested commands.

(system) #6