Skip to content

Instantly share code, notes, and snippets.

@iain17
Last active June 29, 2017 19:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iain17/ac33666873445d4fdff46915241c1157 to your computer and use it in GitHub Desktop.
Save iain17/ac33666873445d4fdff46915241c1157 to your computer and use it in GitHub Desktop.
Rancher little snippets
#SSH into the machine
ssh -i "aws-rancher.pem" rancher@ec2-00-158-000-000.eu-central-1.compute.amazonaws.com
#To switch to a Docker version supported by k8s.
#http://rancher.com/docs/rancher/v1.6/en/hosts/#supported-docker-versions
sudo ros engine switch docker-1.12.6
#Install Rancher
#http://rancher.com/docs/rancher/v1.6/en/installing-rancher/installing-server/
sudo docker run -d -v /home/rancher/mysql:/var/lib/mysql --restart=unless-stopped -p 8080:8080 rancher/server
cd /var
touch swap.img
chmod 600 swap.img
#Add 8gb of memory
dd if=/dev/zero of=/home/rancher/swap.img bs=1024k count=8000
mkswap /home/rancher/swap.img
swapon /home/rancher/swap.img
echo "/home/rancher/swap.img none swap sw 0 0" >> /etc/fstab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment