Skip to content

Instantly share code, notes, and snippets.

@rms1000watt
Created January 14, 2019 03:58
Show Gist options
  • Save rms1000watt/5800e4e686001a75b9aecdf14d49b7b5 to your computer and use it in GitHub Desktop.
Save rms1000watt/5800e4e686001a75b9aecdf14d49b7b5 to your computer and use it in GitHub Desktop.
Install Consul on Linux
#!/usr/bin/env bash
if [[ ! -f /bin/consul ]]; then
CONSUL_VERSION=1.4.0
apt update -y
apt install -y curl unzip
curl -L -o consul_${CONSUL_VERSION}_linux_amd64.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip
unzip -d /bin consul_${CONSUL_VERSION}_linux_amd64.zip
rm consul_${CONSUL_VERSION}_linux_amd64.zip
chmod +x /bin/consul
nohup consul agent -server=false -node=0 -retry-join=consul -data-dir=/tmp/consul &
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment