下载
wget https://releases.hashicorp.com/consul/1.4.2/consul_1.4.2_linux_amd64.zip
解压
unzip consul_1.4.2_linux_amd64.zip -d /usr/bin
创建启动文件
vim /lib/systemd/system/consul.service
[Unit]
Description=consul
[Service]
ExecStart=/usr/bin/consul agent -config-dir /etc/consul
KillSignal=SIGINT
创建配置文件
mkdir /etc/consul/
vim /etc/consul/server.json
{
"data_dir": "/tmp/consul",
"log_level": "INFO",
"node_name": "192.168.211.128",
"server": true,
"bootstrap_expect": 1,
"client_addr": "0.0.0.0",
"advertise_addr": "192.168.211.128",
"advertise_addr_wan": "192.168.211.128"
}
启动
systemctl start consul
转载于:https://www.cnblogs.com/liuxiaoji/p/10337240.html