4

I'm trying to get ElasticSearch running with Laradock. ES looks to be supported out of the box with Laradock.

Here's my docker command (run from <project root>/laradock/:

docker-compose up -d nginx postgres redis beanstalkd elasticsearch

However if I run docker ps, the elasticsearch container isn't running.

Both ports 9200 and 9300 are not consumed:

lsof -i :9200

Not sure why the elasticsearch container doesn't persist, it seems to just self close.

output of docker ps -a after running docker-compose up ...

http://pastebin.com/raw/ymfvLPLT

Condensed version:

IMAGE                     STATUS                        PORTS
laradock_nginx            Up 36 seconds                 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp
laradock_elasticsearch    Exited (137) 34 seconds ago
laradock_beanstalkd       Up 37 seconds                 0.0.0.0:11300->11300/tcp
laradock_php-fpm          Up 38 seconds                 9000/tcp
laradock_workspace        Up 39 seconds                 0.0.0.0:2222->22/tcp
tianon/true               Excited (0) 41 seconds ago
laradock_postgres         Up 41 seconds                 0.0.0.0:5432->5432/tcp
laradock_redis            Up 40 seconds                 0.0.0.0:6379->6379/tcp

Output of docker events after running docker-compose up ...

http://pastebin.com/cE9bjs6i

sayan saha
  • 91
  • 2
  • 8
Harry
  • 2,429
  • 4
  • 21
  • 26

3 Answers3

2

Run on laradock file the command

wsl -d docker-desktop 
sysctl -w vm.max_map_count=262144

https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-cli-run-prod-mode

jmoerdyk
  • 5,544
  • 7
  • 38
  • 49
1

Try to check logs first:

docker logs laradock_elasticsearch_1

(or another name of elasticsearch container)

In my case it was

ERROR: [1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

I found solution here namely, i've run on my Ubuntu machine

sudo sysctl -w vm.max_map_count=262144
vasymus
  • 11
  • 1
0

I don't think the problem is related to Laradock, since Elasticsearch is supposed to be running on it's own, I would first check the memory:

  • open Docker Dashboard -> Settings -> Resources -> Advanced: and increase the memory.
  • check your Machine memory, Elasticsearch won't run if there is not enough memory in your machine.
  • or:
    • open your docker-compose.yml file
    • increase the mem_limit: 1g then
    • docker-compose up -d --build elasticsearch

If it's still not working, remove all the images, update laradock to latest version and setup it new.

Mainhattan
  • 51
  • 1
  • 2