1. 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?".

Discussion in 'Enhanced Search Support' started by Slavik, Feb 1, 2012.

  1. Slavik

    Slavik XenForo Moderator Staff Member

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

    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:
    rcelasticsearch 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.
    tonmo, Big Dan, thumped and 3 others like this.
  2. DRaver

    DRaver Member

    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.

Share This Page