Skip to content

Instantly share code, notes, and snippets.

@pascalandy
Created October 28, 2016 14:55
Show Gist options
  • Save pascalandy/a5d20c29510a96d09102ea0fc4d061f4 to your computer and use it in GitHub Desktop.
Save pascalandy/a5d20c29510a96d09102ea0fc4d061f4 to your computer and use it in GitHub Desktop.
to analyse - user-data.sh
#!/bin/sh
# option 2: paste this into user-data to automate install via boot script
apt-get update -y && apt-get -y dist-upgrade
service lxcfs stop
apt-get remove -y -q lxc-common lxcfs lxd lxd-client
apt-get install -y -q linux-image-extra-$(uname -r) linux-image-extra-virtual
echo "net.ipv4.neigh.default.gc_thresh1 = 30000\nnet.ipv4.neigh.default.gc_thresh2 = 32000\nnet.ipv4.neigh.default.gc_thresh3 = 32768" >> /etc/sysctl.conf
curl -fsSL https://get.docker.com/ | sh
docker swarm join \
--advertise-addr $(curl http://169.254.169.254/latest/meta-data/public-ipv4) \
--token SWMTKN-1-29tx6z2k8zmsbt9z2c2ay54jc9ce2l94ixhmmagveifv3pp4fa-5e8i9gugpb9b4bmi9vrp7m5su \
67.205.160.45:2377
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment