Serf 必須首先安裝在將成為 Serf 集群成員的每個節(jié)點上涩哟。
為了簡化安裝救鲤,Serf 以二進(jìn)制包的形式分發(fā)給所有支持的平臺和架構(gòu)忿檩。
安裝
下載 Serf 后堪遂,解壓縮包介蛉。
將 serf 二進(jìn)制文件復(fù)制到 PATH 上的某個位置,以便可以執(zhí)行它溶褪。
在 Unix 系統(tǒng)上币旧,~/bin 和 /usr/local/bin 是常見的安裝目錄,具體取決于您是要將安裝限制為單個用戶還是將其公開給整個系統(tǒng)猿妈。
在 Windows 系統(tǒng)上吹菱,您可以將它放在任何您想要的位置。
也可以通過標(biāo)準(zhǔn)的 go 命令行實用程序構(gòu)建和安裝 serf 二進(jìn)制文件(go get -u github.com/hashicorp/serf/cmd/serf彭则,它將 serf 安裝為 $GOPATH/bin/serf)鳍刷,但是我們建議 運行正式版本。
OS X
如果您使用 homebrew 作為包管理器贰剥,那么您可以像安裝 serf 一樣簡單: brew install serf
驗證安裝
安裝 Serf 后倾剿,通過打開一個新的終端會話,檢查 serf 安裝是否有效蚌成。
通過執(zhí)行 serf 你應(yīng)該看到類似于下面的幫助輸出:
$ serf
usage: serf [--version] [--help] <command> [<args>]
Available commands are:
agent Runs a Serf agent
event Send a custom event through the Serf cluster
force-leave Forces a member of the cluster to enter the "left" state
info Provides debugging information for operators
join Tell Serf agent to join cluster
keygen Generates a new encryption key
keys Manipulate the internal encryption keyring used by Serf
leave Gracefully leaves the Serf cluster and shuts down
members Lists the members of a Serf cluster
monitor Stream logs from a Serf agent
query Send a query to the Serf cluster
reachability Test network reachability
tags Modify tags of a running Serf agent
version Prints the Serf version
如果你得到一個找不到 serf 的錯誤前痘,那么你的 PATH 環(huán)境變量設(shè)置不正確。 請返回并確保您的 PATH 變量包含安裝 Serf 的目錄担忧。