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

Elasticsearch running - but XF won't reindex

Discussion in 'Enhanced Search Support' started by CyclingTribe, Jan 18, 2012.

  1. CyclingTribe

    CyclingTribe Well-Known Member

    I've enabled elasticsearch in the Options > Search settings and set stemming in the tools page, but when I click to reindex it tells me it cannot find elasticsearch:

    No response returned from Elasticsearch. Is it running?

    It is running on the server - any advice on what to look at first?

    Thanks,
    Shaun :D
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    I don't have it installed so this is just guesswork, but do you have the correct settings in Options -> Search Options: Elasticsearch Server Details ?
     
  3. CyclingTribe

    CyclingTribe Well-Known Member

    Yeah, I think so.

    Does elasticsearch create any "hard" files or directories on the server that I could look out for, to see if it has reached a certain point and then failed?
     
  4. Slavik

    Slavik XenForo Moderator Staff Member

    What does

    Code:
    /etc/init.d/elasticsearch start
    return?
     
  5. CyclingTribe

    CyclingTribe Well-Known Member

    Tells me it is already running ... (y)
     
  6. Slavik

    Slavik XenForo Moderator Staff Member

    Have you manually entered anything into the settings box or just left them as default?

    If you have entered something in, try resetting it to default.
     
  7. CyclingTribe

    CyclingTribe Well-Known Member

    No, haven't changed anything other than select stemming.
     
  8. Mike

    Mike XenForo Developer Staff Member

    Your elasticsearch server may not be binding to the correct IP. You may need to setup your configuration to only bind to your internal IP address (which is probably the safest thing to do).

    The IP it bound to may be in a log file somewhere (depending on configuration), but the easiest thing would be to stop the elasticsearch service and then re-run it in the foreground (/path/to/es/elasticsearch -f) and see what it says. One option would be to enter that IP in XF.
     
    GeeksChat likes this.
  9. CyclingTribe

    CyclingTribe Well-Known Member

    Spot on Mike - it was binding to the wrong address so edited the config file and bound it to 127.0.0.1 and it's now indexing.

    I assume 127.0.0.1 is okay?

    Thanks,
    Shaun :D
     
  10. anonymous

    anonymous Member

    I had this too and had to bind the
    network.host:
    To a specific ip. That solved it for me.
     
    GeeksChat likes this.
  11. CyclingTribe

    CyclingTribe Well-Known Member

    Bloody hell ... it doesn't hang about reindexing does it ... :D
     
  12. Mike

    Mike XenForo Developer Staff Member

    Yeah, or if you want to use a central ES server (because you have multiple web servers), your internal IP. But here, we have it bound to 127.0.0.1 without any issues.
     
    Dan and GeeksChat like this.
  13. CyclingTribe

    CyclingTribe Well-Known Member

    Excellent - thanks for the help, and having just tried a search (whilst it is still reindexing) it is coming back lightning fast - so well worth the investment!! (y)
     
  14. anonymous

    anonymous Member

    It really doesn't, true story: it actually indexed 500k posts that don't show up on the forum stats and I am wondering where it found them (or if it's rather an approximation).
     
  15. Mike

    Mike XenForo Developer Staff Member

    The number you see there is just the ID in the DB. It's not a counter.
     
    anonymous likes this.
  16. Rob

    Rob Well-Known Member

    Ok, I have installed elasticsearch and checked to see if it is running.

    I am confused by the output of these commands:-
    Code:
    [xxxx sbin]# /etc/init.d/elasticsearch start
    Starting elasticsearch: (null) already running.
    failed.
     
     
    [xxxx sbin]# /etc/init.d/elasticsearch stop
    Stopping elasticsearch: start-stop-daemon: warning: failed to kill 23310: No such process
    1 pids were not killed
    No process in pidfile `/var/run/elasticsearch.pid' found running; none killed.
    failed.
     
     
    [xxxx sbin]# /etc/init.d/elasticsearch force-reload
    Stopping elasticsearch: start-stop-daemon: warning: failed to kill 23310: No such process
    1 pids were not killed
    No process in pidfile `/var/run/elasticsearch.pid' found running; none killed.
    failed.
    Starting elasticsearch: (null) already running.
    failed.
    Is it running or not? I think i have stuffed up somewhere. Java is installed ok and is V1.7.0_03
    I've added the service with chkconfig and it didnt return any errors

    Im very confused with the above command outputs.
     
  17. Slavik

    Slavik XenForo Moderator Staff Member

    Type

    Code:
    curl http://127.0.0.1:9200 
    And see what it returns.
     
  18. Rob

    Rob Well-Known Member

    Yeah, its running. I removed and readded the service and now all those commands function fine (weird)

    Thanks!
     
    GeeksChat likes this.
  19. shawn

    shawn Well-Known Member

    If it happens again, type "ps -ax | grep elasticsearch"

    Then whatever PID comes up, type "kill #####".

    Then "service elasticsearch start"
     
  20. Solidus

    Solidus Well-Known Member

    Why that instead of service elasticsearch restart?
     

Share This Page