|
|
@ -72,21 +72,21 @@ if [ $consultype == "client" ]
|
|
|
|
then
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
|
|
cat >/etc/consul.d/consul.hcl <<EOF
|
|
|
|
cat >/etc/consul.d/consul.hcl <<EOF
|
|
|
|
datacenter = "dc1"
|
|
|
|
datacenter = "dc1"
|
|
|
|
data_dir = "/opt/consul"
|
|
|
|
data_dir = "/opt/consul"
|
|
|
|
client_addr = $bind_ip
|
|
|
|
client_addr = $bind_ip
|
|
|
|
retry_join = ["$server_ip"]
|
|
|
|
retry_join = ["$server_ip"]
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
chmod 640 /etc/consul.d/consul.hcl
|
|
|
|
chmod 640 /etc/consul.d/consul.hcl
|
|
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
|
|
cat >/etc/consul.d/server.hcl <<EOF
|
|
|
|
cat >/etc/consul.d/server.hcl <<EOF
|
|
|
|
datacenter = "dc1"
|
|
|
|
datacenter = "dc1"
|
|
|
|
data_dir = "/opt/consul"
|
|
|
|
data_dir = "/opt/consul"
|
|
|
|
bind_addr = $bind_ip
|
|
|
|
bind_addr = $bind_ip
|
|
|
|
server = true
|
|
|
|
server = true
|
|
|
|
bootstrap_expect = 1
|
|
|
|
bootstrap_expect = 1
|
|
|
|
EOF
|
|
|
|
EOF
|
|
|
|
chmod 640 /etc/consul.d/server.hcl
|
|
|
|
chmod 640 /etc/consul.d/server.hcl
|
|
|
|
|
|
|
|
|
|
|
|