Skip to content

Instantly share code, notes, and snippets.

@TimoDJatomika
Last active December 24, 2018 17:36
Show Gist options
  • Save TimoDJatomika/38fbb3734bc7e9adae0eb239c221e26c to your computer and use it in GitHub Desktop.
Save TimoDJatomika/38fbb3734bc7e9adae0eb239c221e26c to your computer and use it in GitHub Desktop.
setup of a high availability vault cluster: consul setup
#!/bin/bash
# author: Timo Stankowitz <timo.stankowitz@inf.h-brs.de>
# version: 6
# last (working) test: 2018-12-24
# prerequirement: all instances must have the "aws tag" "Cluster" with the value of "vault-cluster"
# create directories
mkdir consul-persistent-data
mkdir consul-config
# download configuration
wget https://vault-ha.de/files/consul-config-acl.json -P consul-config
wget https://vault-ha.de/files/consul-config-gossip.json -P consul-config
# run docker container
docker run -d --name "consul" -v /home/core/consul-config/:/consul/config -v /home/core/consul-persistent-data/:/consul/data --net=host consul:1.4.0 agent -server -bootstrap-expect=3 -ui -client=0.0.0.0 -bind=$(ip -4 -o addr show dev eth0 | awk '{split($4,a,"/");print a[1]}') -rejoin -retry-join "provider=aws tag_key=Cluster tag_value=vault-cluster"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment