user3976041
user3976041

Reputation:

Elasticsearch connection error in Ubuntu 16.4

In my ubuntu machine when I run the command curl -X GET 'http://localhost:9200' to test connection it show following message. curl: (7) Failed to connect to localhost port 9200: Connection refused

When i check server status with sudo systemctl start elasticsearch it show following message.

    ● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2016-11-20 16:32:30 BDT; 44s ago
     Docs: http://www.elastic.co
  Process: 8653 ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p ${PID_DIR}/elasticsearch.pid --quiet -Edefault.path.logs=${LOG_DIR} -Edefa
  Process: 8649 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 8653 (code=exited, status=1/FAILURE)

Nov 20 16:32:29 bahar elasticsearch[8653]: 2016-11-20 16:32:25,579 main ERROR Null object returned for RollingFile in Appenders.
Nov 20 16:32:29 bahar elasticsearch[8653]: 2016-11-20 16:32:25,579 main ERROR Null object returned for RollingFile in Appenders.
Nov 20 16:32:29 bahar elasticsearch[8653]: 2016-11-20 16:32:25,580 main ERROR Unable to locate appender "rolling" for logger config "root"
Nov 20 16:32:29 bahar elasticsearch[8653]: 2016-11-20 16:32:25,580 main ERROR Unable to locate appender "index_indexing_slowlog_rolling" for logge
Nov 20 16:32:29 bahar elasticsearch[8653]: 2016-11-20 16:32:25,581 main ERROR Unable to locate appender "index_search_slowlog_rolling" for logger 
Nov 20 16:32:29 bahar elasticsearch[8653]: 2016-11-20 16:32:25,581 main ERROR Unable to locate appender "deprecation_rolling" for logger config "o
Nov 20 16:32:29 bahar elasticsearch[8653]: [2016-11-20T16:32:25,592][WARN ][o.e.c.l.LogConfigurator  ] ignoring unsupported logging configuration 
Nov 20 16:32:30 bahar systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Nov 20 16:32:30 bahar systemd[1]: elasticsearch.service: Unit entered failed state.
Nov 20 16:32:30 bahar systemd[1]: elasticsearch.service: Failed with result 'exit-code'.

Upvotes: 5

Views: 2617

Answers (5)

Han Ye
Han Ye

Reputation: 158

Long story short: a system reboot might get it OK.

It has been a while since the question is asked. Anyway, I ran into a similar problem recently.

The elasticsearch service on one of my nodes died, with error saying similar to those posted in the question when restart the service. It says the log folder to write is read-only file system. But these files and directories are indeed owned by user elasticsearch (version 5.5, deployed on Cent OS 6.5), there should not be a read-only problem.

I checked and didn't find a clue. So, I just reboot the system. After rebooting, everything goes all right without any further tuning: elasticsearch service starts on boot as configured, it finds the cluster and all the other nodes, and the cluster health status turns green after a little while.

I guess, the root reason might be some hardware failure in my case. All data and logs managed by elasticsearch cluster are stored in a 2TB SSD driver mounted on each node. And our hardware team just managed to recover from an external storage failure recently. All the nodes restarted during that recovery. Chances are there are some lagged issues caused the problem.

Upvotes: 0

Yao Li
Yao Li

Reputation: 2266

Usually it's the write permission issue for the log directory (default as /var/log/elasticsearch), use ls -l to check the permission and change mode to 777 for the log directory and files if necessary.

Upvotes: 0

Mutal
Mutal

Reputation: 11

This is the error for the PATH and LOgs in the elasticsearch.yml (etc/elasticsearch/elasticsearch.yml)

Uncheck these path and your error will be removed.

Upvotes: 1

Yao Pan
Yao Pan

Reputation: 524

check if Elasticsearch is running,run the follwing command:

$ ps aux|grep elasticsearch

if Elasticsearch is not started,check your JAVA Environment,download a new Elasticsearch and install it again:

1.check if JAVA is correctly installed:

$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

if your JAVA version is lower 1.7,change a new one.

2.download Elasticsearch install package,unzip it:

$ tar -zxvf elasticsearch-2.3.3.gz

3. run Elasticsearch

$ cd elasticsearch-2.3.3
$ ./bin/elasticsearch

Upvotes: 0

Dan Cadar
Dan Cadar

Reputation: 1

That means elasticsearch is not running. And from what I see, there is a problem with starting it. Check your elasticsearch configuration.

Upvotes: 0

Related Questions