iT邦幫忙

第 12 屆 iThome 鐵人賽

DAY 17
0
DevOps

Hashicorp 0 到 0.003系列 第 17

DAY 17. Nomad integrates with Consul

  • 分享至 

  • twitterImage
  •  

我們有Consul也有Nomad,那麼要善用Consul的service discovery的功能,今天我們把Nomad server與client都註冊到Consul上去吧!

Consul 設定

參考Day 6. Consul client 參數設定與啟動

Nomad server設定

只要在nomad-server.hcl裡加入consul的連線資訊即可,設定完後重起生效。
這裡官網不建議直接連線到Consul server,所以我們連線到local的Consul client,由Consul client來對Consul server做註冊的動作。

# nomad-server.hcl

datacenter = "Nomad-ithome"
...
...
consul {
  address = "127.0.0.1:8500"
  token   = "499defa4-edc9-3f80-d001-95e5df7e21a6"
  server_service_name = "nomad-server"
  server_auto_join = true
}

Nomad client設定

只要在nomad-client.hcl裡加入consul的連線資訊即可,設定完後重起生效。

# nomad-client.hcl

datacenter = "Nomad-ithome"
...
...
consul {
  address = "127.0.0.1:8500"
  token   = "499defa4-edc9-3f80-d001-95e5df7e21a6"
  client_service_name = "nomad-server"
  client_auto_join = true
}

Check

開啟Consul Web UI可以看到我們的Nomad server與Nomad client已經註冊在Consul上了。
https://ithelp.ithome.com.tw/upload/images/20200918/20129223wbynJZVOjP.png


上一篇
Day 16. Nomad client 參數設定與啟動
下一篇
Day 18. Submit Jobs to Nomad
系列文
Hashicorp 0 到 0.00330
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言