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

Slavik

XenForo moderator
Staff member
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:
I want to delete this thing and never renew it.
Feel free to contact us and request it to be removed from your license.

However, you have way more than 1 million posts so I wouldn't recommend it.

As an aside, I haven't had to touch ES or do anything with it since it was installed several years ago.
If you are having constant issues with yours then I would have to suggest that it is due to your host/server.
 
It's been disabled for the past month.

I haven't noticed any difference in speed and the search function works fine without it.

I can't find anywhere that says it is better to use than the normal search on forums with a lot of posts.

https://xenforo.com/help/enhanced-search/

As long as i don't get errors or shuts down my server. I think using the normal search should be ok?
 
Ok, I'll take your word on that. I'll keep this add-on.

I wanted to fix do it myself but it seems i am not skilled enough to do it.

I give up with trying to fix this.

:mad:


thank you andy for helping me. i will call a friends whos done work on my server before to see what's going on.

(y)


I'll stick to html for now
 
Last edited:
Just want to put my vote in here for having a miserable time with this addon. Right out of the gate we are getting the following errors, and hours on the phone with a Linux Admin revealed no solutions. Also if you google this phrase you will see tons of people struggling:
https://www.google.com/search?q=elasticsearch+no+response+returned+is+it+running&ie=utf-8&oe=utf-8

-------------
Anyways here are the errors we're getting. I guess I need to disable and uninstall it. I really think when there are a lot of people over a period of 4 years reporting the same problem and no solution, that maybe the elasticsearch guys should consider modifying the tool to work better.

Maybe our situation is easily fixed? My linux guy says he sees no such service running.

The following error occurred:

An exception occurred: No response returned from Elasticsearch. Is it running? in /var/www/vhosts/hairlosstalk.com/httpdocs/interact/library/XenES/Search/SourceHandler/ElasticSearch.php on line 1021

XenES_Search_SourceHandler_ElasticSearch->_triggerFailedIndexError() in XenES/Search/SourceHandler/ElasticSearch.php at line 76
XenES_Search_SourceHandler_ElasticSearch->finalizeRebuildSet() in XenForo/Search/Indexer.php at line 125
XenForo_Search_Indexer->finalizeRebuildSet() in XenForo/Deferred/SearchIndex.php at line 76
XenForo_Deferred_SearchIndex->execute() in XenForo/Model/Deferred.php at line 295
XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 429
XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 374
XenForo_Model_Deferred->run() in XenForo/ViewRenderer/Abstract.php at line 352
XenForo_ViewRenderer_Abstract::hasManualDeferredToRun() in XenForo/ViewRenderer/Json.php at line 147
XenForo_ViewRenderer_Json::_addDefaultParams() in XenForo/ViewRenderer/Json.php at line 185
XenForo_ViewRenderer_Json::jsonEncodeForOutput() in XenForo/ViewRenderer/Json.php at line 61
XenForo_ViewRenderer_Json->renderError() in XenForo/FrontController.php at line 595
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
XenForo_FrontController->run() in /var/www/vhosts/hairlosstalk.com/httpdocs/interact/admin.php at line 13
 
Update: According to my Linux admin at Rackspace, the tool is looking for a service to be running, the elasticsearch service, at "localhost" (127.0.0.1).

But the question came up: "Did you install this service? Because its looking for it on your box, and a plugin like this wouldn't be capable of installing that service automatically in the first place"

So he suggested manually installing the service himself onto the box, but I wanted to come here and ask what is going on first.

Why's it looking for a service on my box that it wouldn't have been able to install, and why don't we see instructions anywhere stating that the service must be installed locally for the tool to work?

Thanks!
 
Are you referring to this?

"XenForo Enhanced Search requires XenForo 1.1.1 or newer and elasticsearch 0.16.0 or newer. The Enhanced Search add-on requires a separate purchase to become available to a XenForo license."

Three different people saw this and did not digest that in order for ElasticSearch to work in XenForo you have to not only buy XenForo Elastic Search 1.1.4 but .... I guess you also have to buy software directly from ElasticSearch?

Such fine print.

And nothing in the purchase, installation, or setup says "This will not work unless you also buy the server software from ElasticSearch directly"

Is that basically what we are missing?
 
The elasticsearch software is free - it just needs to be installed on the server and set up.

I'm surprised no-one recognised that it's a separate package - the word is linked to the site which distributes the software.
 
It was because of the phrasing I think. Here is how our strange brains interpreted what was written:

The first paragraph:

"XenForo Enhanced Search is an add-on that ... is built on top of elasticsearch"https://www.elastic.co/
We took this as just an FYI. You're buying an Add-On from us that is built on ElasticSearch. And here's a link to their home page if you're curious about it.
So we assumed whatever was needed was included with the Add-On.

The highlighted text below that says:
"The Enhanced Search add-on requires a separate purchase to become available to a XenForo license."
We assumed the separate purchase was the Add-On itself, which it is.
However there is this sentence: "requires XenForo 1.1.1 or newer and elasticsearch 0.16.0 or newer."
We assumed you were just letting us know that v16 of elasticsearch was part of the AddOn.

Why did we make that ridiculous assumption?

Because in context - there is no mention anywhere on this page, or the install text file that you must actually *go* to the ElasticSearch website, find their software, download it, set up repositories, and get their service running on your box before the AddOn will work. That entire process is not even mentioned, and is completely left out.

It does mention that the AddOn requires elasticsearch 0.16.0 to work, but it doesnt say its a separate "service" - just implies its their software, which could've easily been bundled with the AddOn. Ultimately we realized the AddOn was looking for a service on our box, so we realized a service was needed, but we sat there on the phone saying (out loud) "Why don't they actually say that anywhere in either of the installation instructions?"

Brain farts on our part. Maybe adding a couple sentences to the installation instructions will make it more clear for dummies like us. :)
Linking to the actual download page on ElasticSearch would've made it clearer too.
Thanks for the help!
 
Help me please

Xenforo 1.5.10 set:
CentOS 7
nginx
php-fpm
mariadb

ElasticSearch installed and running. When you try to re-index errors occur

Code:
Elasticsearch Server: http://127.0.0.1:9200/codebynet
Elasticsearch does not appear to be running but is enabled as the search system.

Code:
An exception occurred: No response returned from Elasticsearch. Is it running? in /home/admin/web/codeby.net/public_html/forum/library/XenES/Search/SourceHandler/ElasticSearch.php on line 1094

XenES_Search_SourceHandler_ElasticSearch->_triggerFailedIndexError() in XenES/Search/SourceHandler/ElasticSearch.php at line 76
XenES_Search_SourceHandler_ElasticSearch->finalizeRebuildSet() in XenForo/Search/Indexer.php at line 125
XenForo_Search_Indexer->finalizeRebuildSet() in XenForo/Deferred/SearchIndex.php at line 76
XenForo_Deferred_SearchIndex->execute() in XenForo/Model/Deferred.php at line 295
XenForo_Model_Deferred->runDeferred() in XenForo/Model/Deferred.php at line 429
XenForo_Model_Deferred->_runInternal() in XenForo/Model/Deferred.php at line 374
XenForo_Model_Deferred->run() in XenForo/ViewRenderer/Abstract.php at line 352
XenForo_ViewRenderer_Abstract::hasManualDeferredToRun() in XenForo/ViewRenderer/Json.php at line 147
XenForo_ViewRenderer_Json::_addDefaultParams() in XenForo/ViewRenderer/Json.php at line 185
XenForo_ViewRenderer_Json::jsonEncodeForOutput() in XenForo/ViewRenderer/Json.php at line 61
XenForo_ViewRenderer_Json->renderError() in XenForo/FrontController.php at line 595
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
XenForo_FrontController->run() in /home/admin/web/codeby.net/public_html/forum/admin.php at line 13
 
Last edited:
ElasticSearch running on your server?
Yes

Is okay All my ElasticSearch ?
Code:
-bash-4.2# /etc/init.d/elasticsearch status
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2016-10-17 01:04:57 MSK; 5min ago
     Docs: http://www.elastic.co
  Process: 849 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 852 (java)
   CGroup: /system.slice/elasticsearch.service
           └─852 /bin/java -Xms256m -Xmx1g -Djava.awt.headless=true -XX:+UseP...

Oct 17 01:09:55 host1489626 elasticsearch[852]: at org.elasticsearch.cluster...)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at org.elasticsearch.cluster...)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at org.elasticsearch.cluster...)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at org.elasticsearch.cluster...)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at org.elasticsearch.cluster...)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at org.elasticsearch.common....)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at org.elasticsearch.common....)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at java.util.concurrent.Thre...)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at java.util.concurrent.Thre...)
Oct 17 01:09:55 host1489626 elasticsearch[852]: at java.lang.Thread.run(Thre...)
Hint: Some lines were ellipsized, use -l to show in full.
 
Top Bottom