New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elasticsearch is not started #27

Closed
andywenk opened this Issue Jan 16, 2019 · 9 comments

Comments

Projects
None yet
2 participants
@andywenk
Copy link

andywenk commented Jan 16, 2019

Infos:

  • Docker version: Docker Desktop Version 2.0.0.0-mac81 (29211)
  • Operating system (Docker host): Mac OS Mojave Version 10.14.2 (18C54)

Expected behavior:

  • When I start the docker image with docker container run -ti --rm --name zammad -p 80:80 zammad/zammad and I see that elasticsearch is starting, I expect it to be started.
~ ❯❯❯ docker container run -ti --rm --name zammad -p 80:80 zammad/zammad

 Starting services...

[ ok ] Starting PostgreSQL 9.6 database server: main.
[ ok ] Starting Elasticsearch Server:.
[ ok ] Starting Postfix Mail Transport Agent: postfix.
Starting memcached: memcached.
[ ok ] Starting nginx: nginx.

Actual behavior:

  • elasticsearch is not started

Being in the shell of the image I check the status of elasticsearch and it is not running:

root@f3229e48d131:/opt/zammad# /etc/init.d/elasticsearch status
[FAIL] elasticsearch is not running ... failed!

I see in the Rails log, that zammad is not able to connect to elasticsearch:

#<UserAgent::Result:0x00007f852d712b68 @success=false, @body=nil, @data=nil, @code=0, @content_type=nil, @error="#<Errno::EADDRNOTAVAIL: Failed to open TCP connection to localhost:9200 (Cannot assign requested address - connect(2) for \"localhost\" port 9200)>">

Steps to reproduce the behavior:

  • with the given setup, I can reproduce this each time I start the image. Also when I completely remove the image and let docker pull it again ( docker pull zammad/zammad)
@monotek

This comment has been minimized.

Copy link
Member

monotek commented Jan 16, 2019

Did you run this command before the container was started?

sysctl -w vm.max_map_count=262144

@andywenk

This comment has been minimized.

Copy link
Author

andywenk commented Jan 16, 2019

oh yes I forgot to mention. Yes I did but it results in an error and I was not sure, if I have to run this command on my mac or in the container.

~ ❯❯❯ sysctl -w vm.max_map_count=262144                                                                                                                     
sysctl: unknown oid 'vm.max_map_count'

I am confused why I have to do that. And why does it fail? Your help is highly appreciated. Thanks a lot!

@monotek

This comment has been minimized.

Copy link
Member

monotek commented Jan 16, 2019

@andywenk

This comment has been minimized.

Copy link
Author

andywenk commented Jan 17, 2019

@monotek don't worry - your help is much appreciated. I'll see if I can fix it on my box and reply here again.

@andywenk

This comment has been minimized.

Copy link
Author

andywenk commented Jan 17, 2019

So finally I found a solution. I missed, that docker has only 2 GB memory allocated per default.

  1. Increase the memory usage in Docker Desktop or in docker cli
  2. run
    # docker container run -ti --rm --name zammad -p 80:80 zammad/zammad
  3. run
# screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
linuxkit-025000000001:~# sysctl -w vm.max_map_count=262144
vm.max_map_count = 262144
  1. check if elasticsearch is running
root@c96002151e97:/opt/zammad# /etc/init.d/elasticsearch status
[ ok ] elasticsearch is running.

See also: https://stackoverflow.com/questions/41192680/update-max-map-count-for-elasticsearch-docker-container-mac-host.

@andywenk andywenk closed this Jan 17, 2019

@monotek

This comment has been minimized.

Copy link
Member

monotek commented Jan 17, 2019

cool 👍
I reopen until I have time to add it to the docs....

@monotek monotek reopened this Jan 17, 2019

@andywenk

This comment has been minimized.

Copy link
Author

andywenk commented Jan 18, 2019

;-)

@monotek

This comment has been minimized.

@monotek monotek closed this Jan 21, 2019

@andywenk

This comment has been minimized.

Copy link
Author

andywenk commented Jan 21, 2019

👍

@monotek monotek referenced this issue Jan 23, 2019

Closed

502 Bad Gateway #92

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment