Skip to content

Instantly share code, notes, and snippets.

Last active August 30, 2019 06:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save orlea/1151b27245f89cfff4dce95f4a75fbbd to your computer and use it in GitHub Desktop.
EC2 SpotInstanceからdocker swarmに自動参加, EFSマウント
apt update
DEBIAN_FRONTEND=noninteractive apt upgrade -yq
apt install apt-transport-https ca-certificates curl gnupg-agent software-properties-common -y
curl -fsSL | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
apt update
apt install prometheus-node-exporter docker-ce docker-ce-cli nfs-common -y
mkdir /mnt/efs
echo "<AWS-EFS-Address>:/ /mnt/efs nfs4 nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport nofail 0 0" >> /etc/fstab
mount -t nfs4 -o nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport <AWS-EFS-Address>:/ /mnt/efs
docker swarm join --token <token> <manager-ip:port>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment