Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elasticsearch stops after import data from model

  1. I deployed my app to vps.
  2. Started Elasticsearch, and checked it with ps aux | grep elasticsearch
  3. cd app/currect && RAILS_ENV=production bin/rails c
  4. User.import

    Output:

    Scoped order and limit are ignored, it's forced to be batch order and batch size  
      User Load (0.4ms)  SELECT "users".* FROM "users"  ORDER BY "users"."id" ASC LIMIT 10
    Faraday::ConnectionFailed: connection refused: localhost:9200
    
  5. Elasticsearch stopped and import doesn't work, why ?

I am using Ubuntu 14, Puma server, SQLite database. Does it matter?

Additional notes:

https://github.com/rusikf/pmi_parser/blob/master/Gemfile.lock - gemfile.lock from project

http://pastebin.com/J6Wi8qBF - elasticsearch config

http://pastebin.com/3BKmZG4G - elasticsearch log

Before User.import

ps aux | grep elasticsearch

shows elasticsearch process

After User.import ps aux | grep elasticsearch doesn't show process

How to check if elasticsearch uses 9200 port ?

like image 787
rs41 Avatar asked Nov 09 '22 08:11

rs41


1 Answers

The problem was resolved by changing ip to vps ip address:9200 + running Model_name.__elasticsearch__.create_index! force: true in rails console

like image 139
rs41 Avatar answered Nov 15 '22 05:11

rs41