After moving to new server: 'Elasticsearch does not appear to be running but is enabled as the search system.'


Well-known member
I've just moved my forum to a new server, but I'm struggling to make the Enhanced Search work again. When I try to rebuild the search index, I get:

An exception occurred: No response returned from Elasticsearch. Is it running? in */library/XenES/Search/SourceHandler/ElasticSearch.php on line 1191

XenES_Search_SourceHandler_ElasticSearch->_triggerFailedIndexError() in XenES/Search/SourceHandler/ElasticSearch.php at line 81
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 354
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 60
XenForo_ViewRenderer_Json->renderError() in XenForo/FrontController.php at line 613
XenForo_FrontController->renderView() in XenForo/FrontController.php at line 176
XenForo_FrontController->run() in /var/www/ at line 13

I've probably missed something obvious, or perhaps my version of elasticsearch is too new? It's version 7.0.0.

I've installed elasticsearch, and I can see it's up and running:

curl -XGET 'localhost:9200'
  "name" : "********",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "FSOZAIyXSAG0E71-hZCbNA",
  "version" : {
    "number" : "7.0.0",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "b7e28a7",
    "build_date" : "2019-04-05T22:55:32.697037Z",
    "build_snapshot" : false,
    "lucene_version" : "8.0.0",
    "minimum_wire_compatibility_version" : "6.7.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  "tagline" : "You Know, for Search"

XF version is 1.5.23 and ES add-on version is 1.1.8


Well-known member
I managed to make this work in the end. I first downgraded to elasticsearch 6.7, but that didn't help.

The next thing I checked was SELinux. I'm running CentOS with SELinux enabled (enforcing). It turns out the magic spell to make it work is:

sudo setsebool httpd_can_network_connect on -P

(You can check if you have SELinux running in enforcing mode using the command "sestatus".)