如何使用supervisor在docker容器上运行elasticsearch?

时间:2016-10-04 13:18:36

标签: elasticsearch docker supervisord

我遇到了一些在基于debian的容器上运行elasticsearch的问题,这是not being able to find log filesnot being able to run as root的组合。但即使对配置文件进行符号链接也不适用于我。我能够让它运行并认为它可能对某人有帮助。

我使用此命令安装了elasticsearch:

REPORT Z_INCLUDINGTEST.

INCLUDE ZR_PO_NUMBER_UC_INT.

...

1 个答案:

答案 0 :(得分:3)

更新:请参阅@Morfie

中有关弃用的评论
  

已删除设置es.insecure.allow.root标志:https://github.com/elastic/elasticsearch/commit/3ccd59592a46aa26b0675025248a69b4ade3d516

上一个答案:

Dockerfile:

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

supervisord.conf中的elasticsearch条目

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"]