「Nomad」:修訂間差異

出自Gea-Suan Lin's Wiki
跳至導覽 跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
行 15: 行 15:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
cd /tmp; wget https://releases.hashicorp.com/nomad/0.10.2/nomad_0.10.2_linux_amd64.zip; unzip nomad_0.10.2_linux_amd64.zip; sudo install -m 0755 nomad /usr/local/bin/; wget https://raw.githubusercontent.com/hashicorp/nomad/master/dist/systemd/nomad.service; sudo install nomad.service /lib/systemd/system/; sudo service daemon-reload; sudo systemctl enable nomad
cd /tmp; wget https://releases.hashicorp.com/nomad/0.10.2/nomad_0.10.2_linux_amd64.zip; unzip nomad_0.10.2_linux_amd64.zip; sudo install -m 0755 nomad /usr/local/bin/; wget https://raw.githubusercontent.com/hashicorp/nomad/master/dist/systemd/nomad.service; sudo install nomad.service /lib/systemd/system/; sudo service daemon-reload; sudo systemctl enable nomad; sudo mkdir /srv/nomad
</syntaxhighlight>
</syntaxhighlight>



於 2020年1月3日 (五) 08:23 的修訂

NomadHashiCorp推出的資源管理軟體。

架構

Nomad分成Server與Client架構:

  • Server負責協調與分配工作。
  • Client負責實際執行工作。

Server建議至少三台機器,Client建議至少兩台機器。

安裝

Nomad server與Nomad client的安裝都相同(透過設定扮演不同的角色),這邊是安裝0.10.2版,記得到官方網站上確認最新版的號碼後,修改對應的設定:

cd /tmp; wget https://releases.hashicorp.com/nomad/0.10.2/nomad_0.10.2_linux_amd64.zip; unzip nomad_0.10.2_linux_amd64.zip; sudo install -m 0755 nomad /usr/local/bin/; wget https://raw.githubusercontent.com/hashicorp/nomad/master/dist/systemd/nomad.service; sudo install nomad.service /lib/systemd/system/; sudo service daemon-reload; sudo systemctl enable nomad; sudo mkdir /srv/nomad

設定

Nomad server的部份,依照官方的建議放到/etc/nomad.d/server.hcl

datacenter = "us-east-1a"
data_dir = "/srv/nomad"
log_level = "INFO"
region = "us-east-1"
server {
    enabled = true
    bootstrap_expect = 3
    raft_protocol = 3
    server_join {
        retry_join = ["10.1.1.10:4648", "10.1.1.11:4648", "10.1.1.12:4648"]
    }
}

Nomad client的部份,依照官方的建議放到/etc/nomad.d/client.hcl

datacenter = "us-east-1a"
data_dir = "/srv/nomad"
log_level = "INFO"
region = "us-east-1"
client {
    enabled = true
    servers = ["10.1.1.10:4648", "10.1.1.11:4648", "10.1.1.12:4648"]
}
ports {
    http = 5656
}

設定完成後(無論是server或是client)都可以啟用:

sudo service nomad restart
sudo service nomad status

常用指令

nomad server members -address=http://nomad-server:4646
nomad node status -address=http://nomad-server:4646

外部連結