0
では動作しません:領事-テンプレートは、私のような3 machins持つリモートマシン
{
"service":{
"name":"portal_confgen",
"tags":[
"portal"
],
"address": "127.0.0.1",
"port": 8823,
"check":{
"name":"ping",
"script":"ping -c1 192.168.11.155",
"interval":"10s"
}
}
}
と領事を実行しているすべての3機:
[[email protected]]$ consul members
Node Address Status Type Build Protocol DC
portal1 192.168.11.155:8301 alive client 0.7.0 2 dc1
portal0 192.168.14.100:8301 alive client 0.7.0 2 dc1
portal2 192.168.11.182:8301 alive server 0.7.0 2 dc1
、すべて3マシンをのような同じ領事の設定ファイルを持っていますサーバーportal2のみがconsul-templateを実行します。コマンド:
consul-template -config=/home/consul/consul-template/config/hosts.hcl -consul=localhost:8500
私の領事テンプレート設定ファイル、hosts.hcl:
template {
source = "/home/consul/consul-template/hosts.ctmpl"
destination = "/home/consul/conf/conf.d/test.conf"
}
しかし、私は領事ストレージ内のk/vに変更した場合、localhostのみportal2は正しく先のファイルを書き込み、リモートマシンはportal0とportal1私はwork.Whatを見逃さないいません?
すべてのマシンでconsul-templateを実行する必要がありますか? –