|
|
@ -18,7 +18,7 @@ fi
|
|
|
|
mkdir -p /etc/consul.d/ && chown -R consul:consul /etc/consul.d/
|
|
|
|
mkdir -p /etc/consul.d/ && chown -R consul:consul /etc/consul.d/
|
|
|
|
|
|
|
|
|
|
|
|
# write systemd conf
|
|
|
|
# write systemd conf
|
|
|
|
cat >>/etc/systemd/system/consul.service <<EOF
|
|
|
|
cat >/etc/systemd/system/consul.service <<EOF
|
|
|
|
[Unit]
|
|
|
|
[Unit]
|
|
|
|
Description="HashiCorp Consul - A service mesh solution"
|
|
|
|
Description="HashiCorp Consul - A service mesh solution"
|
|
|
|
Documentation=https://www.consul.io/
|
|
|
|
Documentation=https://www.consul.io/
|
|
|
@ -71,7 +71,7 @@ done
|
|
|
|
if [ $consultype == "client" ]
|
|
|
|
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
|
|
|
@ -81,7 +81,7 @@ EOF
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|