From 7f7806ba8e1f9f0708094cbb4d04257455da2a6b Mon Sep 17 00:00:00 2001 From: "Scott S. Lowe" Date: Wed, 21 Sep 2016 09:53:14 -0600 Subject: [PATCH] Fix issue with Consul configuration on VirtualBox Modify `consul.conf` to force Consul to bind to eth1 instead of eth0. Edit `server.json` to use the correct working directory for Consul, as created by `consul.sh` during provisioning. --- consul/consul.conf | 2 ++ consul/server.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/consul/consul.conf b/consul/consul.conf index d045021..ff07906 100644 --- a/consul/consul.conf +++ b/consul/consul.conf @@ -11,9 +11,11 @@ script fi export GOMAXPROCS=`nproc` +BIND_ADDR=`hostname -I | cut -f2 -d' '` exec /usr/local/bin/consul agent \ -config-dir="/etc/consul.d/server" \ + -bind $BIND_ADDR \ ${CONSUL_FLAGS} \ >>/var/log/consul.log 2>&1 end script \ No newline at end of file diff --git a/consul/server.json b/consul/server.json index 2417bec..8582519 100644 --- a/consul/server.json +++ b/consul/server.json @@ -2,7 +2,7 @@ "bootstrap": false, "server": true, "datacenter": "dc1", - "data_dir": "/tmp", + "data_dir": "/var/consul", "log_level": "INFO", "enable_syslog": true, "start_join": ["192.168.100.101", "192.168.100.102", "192.168.100.103"]