Swarmkit筆記(4)——swarmd命令選項

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

Swarmd程式支援的命令選項:

func init() {    mainCmd.Flags().BoolP("version", "v", false, "Display the version and exit")    mainCmd.Flags().StringP("log-level", "l", "info", "Log level (options \"debug\", \"info\", \"warn\", \"error\", \"fatal\", \"panic\")")    mainCmd.Flags().StringP("state-dir", "d", "./swarmkitstate", "State directory")    mainCmd.Flags().StringP("join-token", "", "", "Specifies the secret token required to join the cluster")    mainCmd.Flags().String("engine-addr", "unix:///var/run/docker.sock", "Address of engine instance of agent.")    mainCmd.Flags().String("hostname", "", "Override reported agent hostname")    mainCmd.Flags().String("listen-remote-api", "0.0.0.0:4242", "Listen address for remote API")    mainCmd.Flags().String("listen-control-api", "./swarmkitstate/swarmd.sock", "Listen socket for control API")    mainCmd.Flags().String("listen-debug", "", "Bind the Go debug server on the provided address")    mainCmd.Flags().String("join-addr", "", "Join cluster with a node at this address")    mainCmd.Flags().Bool("force-new-cluster", false, "Force the creation of a new cluster from data directory")    mainCmd.Flags().Uint32("heartbeat-tick", 1, "Defines the heartbeat interval (in seconds) for raft member health-check")    mainCmd.Flags().Uint32("election-tick", 3, "Defines the amount of ticks (in seconds) needed without a Leader to trigger a new election")    mainCmd.Flags().Var(&externalCAOpt, "external-ca", "Specifications of one or more certificate signing endpoints")}

(1)versionlog-levelhostname最簡單,不必細說。
(2)state-dir目錄存放遠端manager以及CA認證等相關資訊:

# ls -alttotal 24drwx------ 5 root root 4096 Jul 29 02:40 .drwx------ 4 root root 4096 Jul 29 02:40 raft-rw------- 1 root root   63 Jul 29 02:40 state.jsondrwxr-xr-x 2 root root 4096 Jul 29 02:40 workerdrwxr-xr-x 2 root root 4096 Jul 29 02:40 certificatesdrwxr-xr-x 3 root root 4096 Jul 29 02:40 ..

(3)join-tokennode用來加入某個clustertoken,在第一次認證請求時會被用到。
(4)engine-addr指定實際用來執行executorengine位置,預設是使用本機Docker
(5)listen-remote-api指定監聽一個tcp port,用來接收和處理其它node的訪問請求。
(6)listen-control-api指定一個Unix socket,用來接收和處理swarmctl程式的訪問請求。
(7)listen-debug指定監聽一個用來debug程式的連接埠。
(8)join-addr指定要加入的cluster的一個node地址,通過串連這個node來加入這個cluster
(9)其餘force-new-clusterheartbeat-tickelection-tickexternal-ca解釋的都很清楚,不必贅述。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.