标签:rap serve ash 127.0.0.1 https ons cli expec oca
centos 7.4.x
consul 1.2.2
list:
172.16.16.103
172.16.16.112
172.16.16.115
下载:
#cd /usr/local/
#wget https://releases.hashicorp.com/consul/1.2.2/consul_1.2.2_linux_amd64.zip
#tar zxvf xxxxxx.zip
#第一台启动
#nohup ./consul agent -bind=172.16.16.112 -server -ui -bootstrap-expect 1 -data-dir=/data/consul/ -node=n1 -client=0.0.0.0 &
第二台启动:
#nohup ./consul agent -bind=172.16.16.112 -server -ui -data-dir=/data/consul/ -node=n2 -client=0.0.0.0 &
#./consul join 172.16.16.112
第三台启动:
#nohup ./consul agent -bind=172.16.16.115 -server -ui -data-dir=/data/consul/ -node=n3 -client=0.0.0.0 &
#./consul join 172.16.16.112
访问web:
http://172.16.16.103:8500/ui/dc1/services
增加服务发现:
curl -X PUT -d ‘{"id": "nginx-1","name": "nginx-1","address": "127.0.0.1","port": 8800,"tags": ["dev"],"checks": [{"http": "http://127.0.0.1:8800/","interval": "5s"}]}‘ http://127.0.0.1:8500/v1/agent/service/register
标签:rap serve ash 127.0.0.1 https ons cli expec oca
原文地址:https://www.cnblogs.com/Qing-840/p/9595675.html