consul 搭建集群介绍

consul 搭建集群介绍

1、环境准备

三台centos 7主机,IP地址

192.168.43.201

192.168.43.140

192.168.43.48

2、程序包版本

consul_1.4.4_linux_amd64.zip

3、目录创建

mkdir -p /usr/local/consul
cd /usr/local/consul;mkdir conf data var log

4、程序部署

unzip consul_1.4.4_linux_amd64.zip
chmod +x /usr/local/consul/consul

5、配置文件创建

cat /usr/local/consul/conf/consul.json

{
  "datacenter": "gl_dc1",
  "data_dir": "/usr/local/consul/data",
  "log_level": "info",
  "node_name": "gl_dc1_consul_node1",
  "server": true,
  "bootstrap_expect": 3,
  "bind_addr": "0.0.0.0",
  "client_addr": "0.0.0.0",
  "advertise_addr": "192.168.43.201",
  "retry_interval": "30s",
  "enable_debug": false,
  "rejoin_after_leave": false,
  "enable_syslog": true,
  "syslog_facility": "local0",
  "ui": true
}

备注:advertise_addr配置成本机IP,三台主机上这个值不同。

猜你喜欢

转载自www.cnblogs.com/shhnwangjian/p/10647532.html