2

I ran into some problems running elasticsearch on a debian-based container, a combination of not being able to find log files and not being able to run as root. But even symlinking the config files didn't work for me. I was able to get it running and thought it might be helpful for somebody.

I installed elasticsearch with this command:

wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | apt-key add - \
    && echo "deb http://packages.elastic.co/elasticsearch/2.x/debian stable main" | tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list \
    && apt-get update \
    && apt-get install -y elasticsearch \
    && update-rc.d elasticsearch defaults 95 10
Community
  • 1
  • 1
mickadoo
  • 3,337
  • 1
  • 25
  • 38

1 Answers1

3

Update: See comment about deprecation from @Morfie

Setting the es.insecure.allow.root flag has been removed: https://github.com/elastic/elasticsearch/commit/3ccd59592a46aa26b0675025248a69b4ade3d516

Previous Answer:

Dockerfile:

RUN mkdir /usr/share/elasticsearch/config \
    && ln /etc/elasticsearch/logging.yml /usr/share/elasticsearch/config/ \
    && ln /etc/elasticsearch/elasticsearch.yml /usr/share/elasticsearch/config/ \
    && chmod 774 /usr/share/elasticsearch/config

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

CMD ["/usr/bin/supervisord"]

And elasticsearch entry in supervisord.conf

[program:elasticsearch]
command=/usr/share/elasticsearch/bin/elasticsearch -Des.insecure.allow.root=true
mickadoo
  • 3,337
  • 1
  • 25
  • 38
  • 1
    Setting the es.insecure.allow.root flag has been removed: https://github.com/elastic/elasticsearch/commit/3ccd59592a46aa26b0675025248a69b4ade3d516 – Morfie May 14 '18 at 20:39
  • Thanks, updated the answer. I don't have any solution now and since I'm not using elastic search via supervisor for anything now it's not a priority for me. – mickadoo May 15 '18 at 22:04