简体   繁体   English

如何在 docker-compose.yml 中为基于 elasticsearch 设置的 docker 提供多级设置

[英]How to provide multi-level settings inside docker-compose.yml for docker based elasticsearch setup

We have docker based elasticsearch cluster for multi-nodes architecture.我们有基于 docker 的 elasticsearch 集群,用于多节点架构。 We provide elasticsearch config as environment variables for respective nodes in docker-compose.yml.我们在 docker-compose.yml 中提供 elasticsearch 配置作为各个节点的环境变量。 We are not using elasticsearch.yml as config file inside docker-compose file.我们没有使用 elasticsearch.yml 作为 docker-compose 文件中的配置文件。

We need to implement slack notification as elasticsearch watcher alerts.我们需要实现松弛通知作为 elasticsearch 观察者警报。 Using following inside elasticsearch.yml, we can enable slack notification:在 elasticsearch.yml 中使用以下内容,我们可以启用松弛通知:

xpack.notification.slack:   account:
    monitoring:
      url: <WEB-HOOK-URL>
      message_defaults:
        from: x-pack
        icon: http://example.com/images/watcher-icon.jpg
        attachment:
          fallback: "X-Pack Notification"
          color: "#36a64f"
          title: "X-Pack Notification"
          title_link: "https://www.elastic.co/guide/en/x-pack/current/index.html"
          text: "One of your watches generated this notification."
          mrkdwn_in: "pretext, text"

The question is, this above config is compatible with elasticsearch.yml, what is its equivalent config using docker-compose.yml without using elasticsearch.yml?问题是,以上配置与 elasticsearch.yml 兼容,使用 docker-compose.yml 而不使用 elasticsearch.yml 的等效配置是什么?

These config should be given as follows:这些配置应如下所示:

xpack.notification.slack.account.monitoring.url: <WEB-HOOK-URL>
xpack.notification.slack.account.monitoring.message_defaults.from: x-pack

docker-compose.yml accepts these config as env config. docker-compose.yml 接受这些配置作为环境配置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM