• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

How to: Fix "No response returned from Elasticsearch. Is it running?".

Slavik

XenForo moderator
Staff member
#1
Fix "No response returned from Elasticsearch. Is it running?"

Please note this guide is less relevant due to recommending Florens repo, whilst the same concepts/troubleshooting methods apply, the paths will not be the same.

This guide is provided for users who may receive the following report in the XenForo error log after installing Elasticseach and XenForo Enhanced Search.

Code:
"No response returned from Elasticsearch. Is it running?".
This guide assumes the user has basic knowledge of SSH and prior to starting the steps below has logged in as root. Please note, whilst this is a simple and easy guide, I take no responsibility for any damages or losses that may occur to your system by following the steps below. If you are unsure at any stage, please ask for assistance or seek the help of a qualified Linux Systems Administrator.

Causes of the Error

This error is usually caused by one of two problems. Firstly the error may be caused if the Elasticsearch Service has not been activated, or has stopped running, for example, following a server restart. Secondly, dependent upon your server configuration, the Elasticsearch Service may be incorrectly binding to an IP or Port, which, your XenForo installation has not been configured to use.

Step 1

Confirm Elasticsearch is running by using the following command.

Code:
ps -A
A long list of running proccesses will be provided, you will be looking for one similar to

Code:
17927 ?        00:00:04 elasticsearch-l
If you see this line then you know the Elasticsearch Service is running. If you cannot find the Elasticsearch service running then use the following command to manually start the service.

RHEL/SUSE
Code:
 service elasticsearch start
Debian/Ubuntu
Code:
/etc/init.d/elasticsearch restart
You should get the following output

Code:
Starting ElasticSearch...
Waiting for ElasticSearch......
running: PID: xxxxx
Step 2

Explicitly bind the Elasticsearch IP and Port.

In this guide we will bind the Elasticsearch Service to the default IP 127.0.0.1 and Port 9200

RHEL/SUSE
Open up /elasticsearch/config/elasticsearch.yml and on line 199 edit

Code:
# network.host: 192.168.0.1
to

Code:
network.host: 127.0.0.1
On line 211 edit

Code:
# http.port: 9200
to

Code:
http.port: 9200
Save and Exit

Restart the Elasticsearch Service by typing the following in SSH

Code:
rcelasticsearch restart
You should get the following output

Code:
Stopping ElasticSearch...
Stopped ElasticSearch.
Starting ElasticSearch...
Waiting for ElasticSearch......
running: PID: xxxxx
Elasticsearch is now runing with your updated config.

Debian/Ubuntu
Open up /usr/local/elasticsearch/config/elasticsearch.yml and on line 199 edit

Code:
# network.host: 192.168.0.1
to

Code:
network.host: 127.0.0.1
On line 211 edit

Code:
# http.port: 9200
to

Code:
http.port: 9200
Save and Exit

Restart the Elasticsearch Service by typing the following in SSH

Code:
/etc/init.d/elasticsearch restart
You should get the following output

Code:
Stopping ElasticSearch...
Stopped ElasticSearch.
Starting ElasticSearch...
Waiting for ElasticSearch......
running: PID: xxxxx
Elasticsearch is now runing with your updated config.

Step 3

Confirm Elasticsearch is listening on your bound IP and Port.

In SSH type the following

Code:
curl http://127.0.0.1:9200
You should get output similar to the following

Code:
{
  "ok" : true,
  "name" : "Wild Child",
  "version" : {
    "number" : "0.18.7",
    "snapshot_build" : false
  },
  "tagline" : "You Know, for Search",
  "cover" : "DON'T PANIC",
  "quote" : {
    "book" : "The Hitchhiker's Guide to the Galaxy",
    "chapter" : "Chapter 8",
    "text1" : "\"Space,\" it says, \"is big. Really big. You just won't believe how vastly hugely mindbogglingly big it is. I mean you may think it's a long way down the road to the chemist, but that's just peanuts to space, LISTEN!\" and so on..."
  }
Congratulations, we have just confirmed Elasticsearch is running and configured to listen on the correct IP and Port.

Step 4

Explicitly set IP and Port in Xenforo.

Within the XenForo admin go to Options > Search Options and within the Elasticsearch Server Details boxes enter 127.0.0.1 and 9200 respectively.

Save Changes

Reindex your board

Congratulations, everything should be working fine now.

Help it still doesn't work!

Your servers security rules such as your Firewall may be blocking access to the required port. You may need to unblock this IP within your security or Firewall settings. If you still have issues after this please make a thread requesting support on the XenForo forums or ticket system.
 
Last edited:

DRaver

Active member
#2
Is this still up to date?

My output on debain wheezy:

ps -A

There is nothing to see of elasticsearch

The output of a restart is:

Code:
 /etc/init.d/elasticsearch restart
[ ok ] Stopping ElasticSearch Server:.
[ ok ] Starting ElasticSearch Server:.
There is no "...running: PID"

After ps -A there is nothing to see from elasticsearch but

ps aux | grep ElasticSearch

show me this:

Code:
ps aux | grep ElasticSearch
107      10236  1.9  0.8 3752884 275384 ?      Sl  10:12  0:05 /usr/lib/jvm/java-7-openjdk-amd64//bin/java -Xms3g -Xmx3g -Xss256k -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.pidfile=/var/run/elasticsearch.pid -Des.path.home=/usr/share/elasticsearch -cp :/usr/share/elasticsearch/lib/elasticsearch-0.90.3.jar:/usr/share/elasticsearch/lib/*:/usr/share/elasticsearch/lib/sigar/* -Des.default.config=/etc/elasticsearch/elasticsearch.yml -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.work=/tmp/elasticsearch -Des.default.path.conf=/etc/elasticsearch org.elasticsearch.bootstrap.ElasticSearch
root    10880  0.0  0.0  9228  880 pts/0    S+  10:16  0:00 grep ElasticSearch
I think it's started.
 

Joshua

Active member
#3
I am getting this error more than a few times while rebuilding the index on my 800,000+ post site.
I have ES running on a separate VPS. I presume that would change some of the settings I'm supposed to edit in tutorial. Can you provide any insight into how the guide might change with the webserver on one VPS and the search server on a different VPS?
 

realaqu

Active member
#4
I am getting this error more than a few times while rebuilding the index on my 800,000+ post site.
I have ES running on a separate VPS. I presume that would change some of the settings I'm supposed to edit in tutorial. Can you provide any insight into how the guide might change with the webserver on one VPS and the search server on a different VPS?
800, 000+ post, do you have at least 4g ram on your VPS?
 

realaqu

Active member
#6
ok, wild guess, good luck

did you install java openjdk1.7, in my case, I installed
yum install java-1.7.0-openjdk.x86_64

set default heap size to 2048?

did you make a directory /var/elasticsearch for ES data?

did you put a space before any variable?


path.data: /var/elasticserach <-corrent

_path.data:/var/elasticsearch <-wrong, my ES failed to start because there is a space in front of path.data
^
 

Slavik

XenForo moderator
Staff member
#7
I am getting this error more than a few times while rebuilding the index on my 800,000+ post site.
I have ES running on a separate VPS. I presume that would change some of the settings I'm supposed to edit in tutorial. Can you provide any insight into how the guide might change with the webserver on one VPS and the search server on a different VPS?
First up... check the logs in /elasticsearch/logs and look for something which might give an idea why.

Most likely either

a) Your doing a too big batch size
b) Your hitting the open file limit.
 

Joshua

Active member
#8
Hmmm
Could it be from these log entries:
JVM received a signal SIGKILL (9)
JVM process is gone
JVM exited unexpectedly

It looks like there are daily log files but not for 4/20 or 4/21...
 

FredC

Well-known member
#12
Ugh what language was the tutorial made in? Elastic search on my form has apparently crashed and I don't have the foggiest about what any of that and the first post means. That and SSL problems along with DNS issues over the last week are just kicking my butt. :(
 

FredC

Well-known member
#14
There are several people on here that manage servers - perhaps engaging their services is a good idea.
Yeah that's what I did and when the problems started (although i don't think they are related), but I ran out of money so trying to figure all this out on my own now. Lost half my visitors so even Adsense took a dive. It's just one of those conundrums. Gotta figure this stuff out for myself before I go bankrupt. I was hoping that restarting elasticsearch would be as easy as pushing a button like Apache or other services. But apparently that's not the case.
-------------
edit: Elasticsearch has been restored!
 
Last edited:

51463

Well-known member
#17
When i run :
Code:
ps -A
I don't see anything about elasticsearch


When i run
Code:
/etc/init.d/elasticsearch restart
i get:

Code:
Stopping elasticsearch:                                    [  OK  ]
Starting elasticsearch:                                    [  OK  ]

then i type in
Code:
curl http://127.0.0.1:9200

i get:
Code:
root@server [~]# curl http://127.0.0.1:9200
{
  "status" : 200,
  "name" : "I deleted the name",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "1.4.2",
    "build_hash" : "I deleted the number",
    "build_timestamp" : "2014-12-16T14:11:12Z",
    "build_snapshot" : false,
    "lucene_version" : "4.10.2"
  },
  "tagline" : "I delete the tagline"
}

I deleted some thing because i thought maybe they were password, anyways
Mine doesn't have a
"ok" : true,


does this mean it's working?
 
Last edited:

51463

Well-known member
#20
I've had nothing but trouble for 1 year with this elastic search thing. It stops working and it's really hard to fix it for beginners.

Is it really nessessary for a forum? I don't see the benefit or having this add-on. My search is working fine without it and it the normal search never gives me problems.

I want to delete this thing and never renew it.