当前位置:网站首页>Quickly create a consumer cluster

Quickly create a consumer cluster

2022-06-23 08:10:00 Ruohai

Operating environment

  • Three stations AlpineLinux host
    • The host names are host-11/12/13
    • IP The addresses are 192.168.0.11/12/13

Automatically execute scripts

#!/bin/sh
#

###############################################################
# consul-1/2/3

apk add consul
rc-update add consul boot

cat <<EOF >/etc/consul/server.json
{
  "datacenter": "test",
  "data_dir": "/var/consul",
  "server": true,
  "bootstrap_expect": 3,
  "bind_addr": "{{ GetInterfaceIP \"eth0\" }}",
  "client_addr": "0.0.0.0",
  "retry_join": [
    "192.168.0.11",
    "192.168.0.12",
    "192.168.0.13"
  ],
  "ui_config": {
    "enabled": true
  }
}
EOF

rc-service consul start

###############################################################
# consul-cli

consul members

consul operator raft list-peers
原网站

版权声明
本文为[Ruohai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/01/202201122038240499.html