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.
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
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: