docker swarm unlock-key
描述 | 管理解鎖金鑰 |
---|---|
用法 | docker swarm unlock-key [OPTIONS] |
Swarm 此命令適用於 Swarm 編排器。
描述
解鎖金鑰是解鎖 Docker 守護程序重啟後的管理節點所需的金鑰。這些金鑰僅在為 Swarm 啟用自動鎖定功能時使用。
您可以使用 `swarm unlock-key` 檢視或輪換解鎖金鑰。要檢視金鑰,請執行不帶任何引數的 `docker swarm unlock-key` 命令。
注意這是一個叢集管理命令,必須在 Swarm 管理器節點上執行。要了解管理器和工作器,請參閱文件中的Swarm 模式部分。
選項
選項 | 預設值 | 描述 |
---|---|---|
-q, --quiet | 僅顯示令牌 | |
--rotate | 輪換解鎖金鑰 |
示例
$ docker swarm unlock-key
To unlock a swarm manager after it restarts, run the `docker swarm unlock`
command and provide the following key:
SWMKEY-1-fySn8TY4w5lKcWcJPIpKufejh9hxx5KYwx6XZigx3Q4
Remember to store this key in a password manager, since without it you
will not be able to restart the manager.
使用 `--rotate` 標誌將解鎖金鑰輪換為新的隨機生成金鑰
$ docker swarm unlock-key --rotate
Successfully rotated manager unlock key.
To unlock a swarm manager after it restarts, run the `docker swarm unlock`
command and provide the following key:
SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8
Remember to store this key in a password manager, since without it you
will not be able to restart the manager.
`-q`(或 `--quiet`)標誌僅列印金鑰
$ docker swarm unlock-key -q
SWMKEY-1-7c37Cc8654o6p38HnroywCi19pllOnGtbdZEgtKxZu8
--rotate
此標誌會輪換解鎖金鑰,將其替換為新的隨機生成金鑰。舊的解鎖金鑰將不再被接受。
--quiet
僅列印解鎖金鑰,不含說明。