ElasticSearch does not work on localhost: 9200 after installing apt-get

I installed elasticsearch from Ubuntu repositories using

sudo apt-get install elasticsearch 

After that, I assumed that the service would be configured and started, but when I opened localhost:9200 , it was not started. Is there any additional configuration or command that I need to run?

Edit: I also ran sudo systemctl start elasticsearch.service (ubuntu is on systemd), but no effect.

+5
source share
4 answers

From pure ubuntu 16 (in the stroller) I have success starting with an elastic search, taking the following steps:

 apt install elasticsearch 

uncomment the line in /etc/default/elasticsearch

 START_DAEMON=true 

And this is important:

 systemctl restart elasticsearch 

Please note that start will not work, because elasticsearch is disabled by default, but systemd considers it to be running (it is something like “running in the disconnected state”), so after changing the default file, you should restart the service

Additional information: https://discuss.elastic.co/t/cant-start-elasticsearch-with-ubuntu-16-04/48730

+1
source

Elicsearch does not start automatically after installation. You must enable elasticsearch explicitly, see https://www.elastic.co/guide/en/elasticsearch/reference/5.5/deb.html

+5
source

Run systemctl status elasticsearch if you are not getting any logs in /var/log/elasticsearch . You can scroll this pin through f (to fast forward) and b (to reverse) if necessary.

You may not have enough memory (RAM).

+2
source

Elicsearch takes some time to come up completely, here are some of the things you can check:

Check limits in /etc/security/limits.conf

 elasticsearch - nofile 65536 

Also check this out at /etc/pam.d/su

 session required pam_limits.so 

If you use systemd check in /usr/lib/systemd/system/elasticsearch.service

 [Service] LimitMEMLOCK=infinity 

Also add this:

 LimitNOFILE=131070 

Now check the memory in /etc/elasticsearch/jvm.options , this is what depends on your system, you will need to fine tune it if I use this feature:

 -Xms{{ (ansible_memtotal_mb * 0.0007) | int }}g -Xmx{{ (ansible_memtotal_mb * 0.0007) | int }}g 

but for starters, you can just use half of your system, if you have 16 GB, give 8:

 -Xms8g -Xmx8g 

And last but not least, know the resources that the moose stack may need:

The device with 64 GB of RAM is an ideal place for sweets, but 32 GB and 16 GB machines are also common.

https://www.elastic.co/guide/en/elasticsearch/guide/current/hardware.html#_memory

+1
source

Source: https://habr.com/ru/post/1270897/


All Articles