一.安装并加入环境变量
1、[root@localhost ~]# yum install -y unzip
2、[root@localhost ~]# yum install -y wget
3、[root@localhost ~]# wget https://releases.hashicorp.com/consul/1.7.2/consul_1.7.2_linux_amd64.zip
4、[root@localhost ~]# ll
5、[root@localhost ~]# unzip consul_1.7.2_linux_amd64.zip
编辑 /etc/profile 文件,添加环境变量,保存后退出。
vi /etc/profile
export CONSUL_HOME=/usr/local/bin/consul
export PATH=$PATH:CONSUL_HOME
// 使用环境变量配置生效
source /etc/profile
2.启动agent (post默认8500)
nohup ./consul agent -dev -client 0.0.0.0 -ui &
3.检查consul是否启动
netstat -anp|grep 8500