docs icon indicating copy to clipboard operation
docs copied to clipboard

elastic search won't run with data volume mapped

Open dansantner opened this issue 11 years ago • 3 comments

I'm on a mac. I use the command docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 elasticsearch to launch elastic but it immediately shuts down with this message

{1.7.3}: Initialization Failed ...

  • ElasticsearchIllegalStateException[Failed to created node environment] AccessDeniedException[/usr/share/elasticsearch/data/elasticsearch]

Any ideas on how to fix?

dansantner avatar Oct 21 '15 11:10 dansantner

This is a permissions issue since the mounted folder from your host is owned by uid/gid 1000:50 whereas the user in the container is elasticsearch (105:108). There is much discussion over on https://github.com/boot2docker/boot2docker/issues/581.

yosifkit avatar Oct 21 '15 18:10 yosifkit

thanks for responding @yosifkit.

dansantner avatar Oct 22 '15 11:10 dansantner

I am also facing the issue, I solved it with adding this to my Dockerfile:

RUN usermod -u 1000 www-data
RUN groupmod -g 1000 www-data

endrezalan avatar Aug 20 '19 19:08 endrezalan