gpt4 book ai didi

elasticsearch - 如何使用主管在 docker 容器上运行 elasticsearch?

转载 作者:行者123 更新时间:2023-12-02 18:16:23 24 4
gpt4 key购买 nike

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

我用这个命令安装了elasticsearch:

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

最佳答案

更新:请参阅@Morfie 关于弃用的评论

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



上一个答案:

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

和 supervisord.conf 中的 elasticsearch 条目
[program:elasticsearch]
command=/usr/share/elasticsearch/bin/elasticsearch -Des.insecure.allow.root=true

关于elasticsearch - 如何使用主管在 docker 容器上运行 elasticsearch?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39853439/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com