3-5台linux系统的机器,下面以3台为例

1 123.206.68.101 172.21.0.17

2 123.206.47.101 172.21.0.4

3 140.143.53.153 172.21.0.10

1.下载Consul

https://www.consul.io/downloads.html

consul下载下来后貌似没有后缀

2.将安装文件复制到3个机器

scp consul [email protected]:/root/install

scp consul [email protected]:/root/install

scp consul [email protected]:/root/install

3.启动Consul集群

(1)服务器1(172.21.0.17)启动serverAgent

 nohup ./consul agent -server -data-dir=/root/install/consuldata -node=server-1 -bind=172.21.0.17 -bootstrap-expect 1 -client 0.0.0.0 -ui  &

  

consul agent 创建一个consul agent
-server 有此参数说明是serverAgent,没有说明为clientAgent
-data-dir 数据(集群信息、注册服务信息、健康检查信息等)存储的目录
-node 节点名称,集群中唯一
-bind 节点的IP地址
-bootstrap-expect 1 延迟日志复制的启动
-client 0.0.0.0-ui 启动ConsulUI,不添加只能在本机上使用
-dc 数据中心

 (2)服务器2(172.21.0.4)

 nohup ./consul agent  -data-dir=/root/install/consuldata -node=client-2 -bind=172.21.0.4 -join=172.21.0.17  &

 (3)服务器3(172.21.0.10)

nohup ./consul agent  -data-dir=/root/install/consuldata -node=client-3 -bind=172.21.0.10 -join=172.21.0.17  &

Consul集群


相关文章:

  • 2021-06-09
  • 2021-11-07
  • 2021-10-05
  • 2021-09-28
  • 2021-05-10
  • 2021-10-27
  • 2021-03-31
猜你喜欢
  • 2021-07-12
  • 2021-10-21
  • 2021-06-02
  • 2021-05-17
  • 2021-10-05
相关资源
相似解决方案