尹小鱼 2020-06-03
https://blog.51cto.com/9025736/2498152
https://blog.51cto.com/9025736/2500976
[ consul.d]# cat redis-6379.json { "services": [ { "id": "redisnode1", "name": "redis", "tags": [ "master" ], "address": "192.168.31.178", "port": 6379, "checks": [ { "args": ["/usr/bin/bash","/data/a.sh"], "interval": "5s" } ] }, { "id": "redisnode2", "name": "redis", "tags": [ "master" ], "address": "192.168.31.179", "port": 6379, "checks": [ { "args": ["/usr/bin/bash","/data/b.sh"], "interval": "5s" } ] }, { "id": "redisnode3", "name": "redis", "tags": [ "master" ], "address": "192.168.31.180", "port": 6379, "checks": [ { "args": ["/usr/bin/bash","/data/c.sh"], "interval": "5s" } ] } ] } consul reload
停止192.168.31.178 redis-server
停止192.168.31.180 redis-server 开启 192.168.31.178 redis-server