【问题标题】:Stopping prometheus docker container gracefully优雅地停止 prometheus docker 容器
【发布时间】:2017-04-28 03:56:42
【问题描述】:

我在 centos 上的 docker 容器中运行 prometheus。我想知道是否有办法优雅地停止普罗米修斯(没有数据损坏)。运行docker stop 会起作用吗?我在这方面找不到任何文档,而且我是 linux、docker 和 prometheus 的新手。

【问题讨论】:

标签: docker centos prometheus


【解决方案1】:

是的,这应该可以。

docker stop 向 PID1 的进程发送 SIGTERM 信号,如果您使用的是官方映像,则该进程是 prometheus。如果在一段时间内(默认 10s)没有收到应答,docker 将发送 SIGKILL 信号并终止进程。

预计 Prometheus 会在收到 SIGTERM 时彻底关闭,但这可能需要超过 10 秒的时间。看 https://prometheus.io/docs/introduction/faq/#troubleshooting

您可能需要延长 docker 在发送 SIGKILL 之前等待的时间。 例如:docker stop --time 50 根据您的 Prometheus 设置,您必须在此处找到正确的设置。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-10
    • 2018-09-08
    • 1970-01-01
    • 2021-04-06
    • 1970-01-01
    • 2017-09-20
    • 1970-01-01
    • 2016-04-02
    相关资源
    最近更新 更多