2017-03-15 46 views
1

我創建了一個docker swarm服務,如果其中一個容器在服務中停止,它將立即將docker容器調度到其中一個可用swarm節點,我想使用docker API將該時間表延遲5秒鐘。在API版本1.26 docs那裏它指定類似這樣的東西碼頭羣服務如何在重啓策略中指定延遲時間?

"RestartPolicy": { "Condition": "on-failure", "Delay": 10000000000, "MaxAttempts": 10 } 什麼是(Dealy:10000000000)。是毫秒還是納秒?

+0

我認爲只適用於碼頭工人發動機的重新啓動容器政策。 Swarm編排位於此層之上,並且我不確定兩者都嘗試重新啓動容器時的行爲。我知道有一個懸而未決的問題,即從當前默認0秒添加指數退避:https://github.com/docker/swarmkit/issues/1201 – BMitch

回答

0

最新泊塢窗API 1沒有規定,但我們可以假設它指的是納秒,因爲健康檢查持續時間也是毫微:

**Interval** - The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit. 

**StartPeriod** - The time to wait for container initialization before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms). 0 means inherit.