Centos7 安装部署 Consul

官方下载地址

Downloads | Consul by HashiCorp

Centos7 安装部署 Consul_第1张图片

 

将安装文件上传到服务器并解压到 /usr/local 目录

unzip consul_1.11.1_linux_amd64.zip -d /usr/local

cd /usr/local/

./consul

Centos7 安装部署 Consul_第2张图片

 

配置consul为后台服务,开机自启

vi /lib/systemd/system/consul.service

[Unit]

Description=consul

[Service]

ExecStart=/usr/bin/consul agent -config-dir /etc/consul -ui

KillSignal=SIGINT

创建配置文件

mkdir /etc/consul/

vim /etc/consul/server.json

{

"data_dir": "/tmp/consul",

"log_level": "INFO",

"node_name": "172.168.50.132",

"server": true,

"bootstrap_expect": 1,

"client_addr": "0.0.0.0",

"advertise_addr": "172.168.50.132",

"advertise_addr_wan": "172.168.50.132"

}

启动

systemctl start consul

systemctl enable consul #开机启动

参考链接:https://www.cnblogs.com/liuxiaoji/p/10337240.html

你可能感兴趣的:(Linux,consul,linux,服务器,centos)