Consul必須首先安裝在每一個節點上當該節點須要稱爲Consul集羣中的成員。爲了使得安裝更容易,Consul爲全部支持的平臺提供了二進制安裝包。本頁面不描述如何從源碼來編譯Consul。html
爲了安裝Consul,須要在下載頁面中找到和你係統匹配的包。Consul被打包成zip格式的壓縮包。node
解壓Consul zip包,複製consul二進制文件到系統PATH中包含的路徑下,以確保它能夠被執行。在Unix系統中,~/bin和/usr/local/bin是一般的安裝路徑,選擇哪一個依賴於你安裝Consul給單個用戶使用仍是全部用戶均可以使用。對於Windows系統,你能夠安裝到任意目錄,不過不要忘記將安裝目錄加入到%PATH%中去。bash
若是你使用homebrew做爲你的包管理器,你能夠經過它來安裝Consul:ide
$ brew cask install consul
若是沒有cask plugin,那你能夠經過下面命令安裝:翻譯
$ brew install caskroom/cask/brew-cask
安裝Consul後,經過打開新的終端回話而且輸入consul是否可用來驗證安裝是否工做。經過執行consul你應該能夠看到下面相似的輸出:debug
$ consul usage: consul [--version] [--help] <command> [<args>] Available commands are: agent Runs a Consul agent event Fire a new event exec Executes a command on Consul nodes force-leave Forces a member of the cluster to enter the "left" state info Provides debugging information for operators join Tell Consul agent to join cluster keygen Generates a new encryption key leave Gracefully leaves the Consul cluster and shuts down members Lists the members of a Consul cluster monitor Stream logs from a Consul agent reload Triggers the agent to reload configuration files version Prints the Consul version watch Watch for changes in Consul
若是終端報告consul沒有被找到的錯誤,那多是你的PATH沒有被正確的設置致使的。請會到前面的步驟去檢查你的PATH環境變量是否包含了安裝Consul目錄。代理
Consul已經安裝完成,讓咱們來啓動代理!code
翻譯自這裏orm