Skip to content

Instantly share code, notes, and snippets.

@byteshiva
Forked from jmcarbo/install_cluster_node
Last active August 25, 2016 06:26
Show Gist options
  • Save byteshiva/0f13bf2fada3308d9335cb5341a382d5 to your computer and use it in GitHub Desktop.
Save byteshiva/0f13bf2fada3308d9335cb5341a382d5 to your computer and use it in GitHub Desktop.
install cluster node
rm -rf /tmp/install
mkdir -p /tmp/install
cd /tmp/install
apt-get update
apt-get install -y wget unzip dnsutils
wget https://releases.hashicorp.com/consul/0.6.4/consul_0.6.4_linux_amd64.zip
unzip consul_0.6.4_linux_amd64.zip
install consul /usr/local/bin/consul
mkdir -p /etc/consul
mkdir -p /var/lib/consul
cat >/etc/consul/consul.conf <<EOF
{
"data_dir": "/var/lib/consul/data",
"ui_dir": "/var/lib/consul/ui",
"client_addr": "0.0.0.0",
"ports": {
"dns": 53
},
"recursor": "8.8.8.8"
}
EOF
wget wget http://stedolan.github.io/jq/download/linux64/jq
install jq /usr/local/bin/jq
wget -O /usr/local/bin/weave https://raw.githubusercontent.com/zettio/weave/master/weave
chmod a+x /usr/local/bin/weave
weave launch
weave expose 192.168.1.2/24
sleep 5
weave connect weave-01
sleep 5
rm -rf /tmp/consul
nohup consul agent -server -config-file=/etc/consul/consul.conf -data-dir /tmp/consul -bind 192.168.1.2 -join 192.168.1.1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment