Last active
September 27, 2020 17:53
-
-
Save cbednarski/8a999e51d8b094ccd74b to your computer and use it in GitHub Desktop.
Ubuntu installer script for consul
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x | |
mkdir -p /tmp/consul | |
cd /tmp/consul | |
# Consul Configuration File | |
tee consul.json <<CONSULCONFIG | |
{ | |
"bootstrap_expect": 3, | |
"client_addr": "0.0.0.0", | |
"data_dir": "/var/lib/consul", | |
"datacenter": "vagrant", | |
"enable_syslog": true, | |
"log_level": "INFO", | |
"server": true, | |
"ui_dir": "/opt/consul-ui" | |
} | |
CONSULCONFIG | |
# Consul Upstart Script | |
tee consul.upstart.conf <<CONSULUPSTART | |
# /etc/inid/consul.conf | |
exec consul agent -config-dir /etc/consul | |
CONSULUPSTART | |
# Download things | |
wget -q -nc https://dl.bintray.com/mitchellh/consul/0.5.0_linux_amd64.zip | |
wget -q -nc https://dl.bintray.com/mitchellh/consul/0.5.0_web_ui.zip | |
# Update | |
apt-get update -qq | |
apt-get install -y unzip | |
# Install everything | |
unzip -o 0.5.0_linux_amd64.zip | |
unzip -o 0.5.0_web_ui.zip | |
stop consul || true | |
cp consul /usr/local/bin/consul | |
mkdir -p /opt/consul-ui | |
cp -R dist/* /opt/consul-ui | |
mkdir -p /etc/consul | |
mkdir -p /var/lib/consul | |
cp consul.json /etc/consul/consul.json | |
cp consul.upstart.conf /etc/init/consul.conf | |
restart consul || start consul |
Works great, Thanks
Works great, Thanks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works great, thanks a bunch!