Home > Docker, Linux > Installing RancherOS and Rancher

Installing RancherOS and Rancher

Install RancherOS

RancherOS installation docs are available at these links.

Docs are available here and here.

I found the docs a bit confusing so have included the steps I used here:

OS installation:

By default, any changes won’t persist and will be lost on reboot. The following steps explain how to install the OS on your hard disk:

Configure a new Linux 4.x compatible VM (>1.5G ram) and boot the memory based OS from CD. Get the most recent ISO release here.

When booted from CD, a shell for user rancher starts on the console. Unless your console allows cut/paste, you’ll want to set a password for user rancher to allow SSH login. SSH key howto.

$ sudo passwd rancher

Login using SSH ($ ssh [email protected])
. Note: this key will not survive a reboot, so in the following steps decline any offers to reboot.

Place your public SSH key in /home/rancher/cloud-config.yml using the following format:

hostname: myhost (optional)
– ssh-rsa AAAAB3NzaC1y…qKxUCAnBOcZ [email protected]
[there should be a couple of spaces at the beginning of the previous line, before the dash]

Format the drive where you want to install rancherOS. This command also labels the drive as required by Rancher. Ignore the rancher doc suggestion to reboot after this command.

$ sudo mkfs.ext4 -L RANCHER_STATE /dev/sda (may not be /dev/sda – with kvm, i use /dev/vda)

Now install RancherOS to disk, along with the SSH key you provided:

$ sudo ros install -c cloud-config.yml -d /dev/sda (again, change sda if necessary)

Reply Y to continue, and then Y to reboot.

If you need to change the hostname:

$ sudo ros config set hostname

Install Rancher Server and Agent

Rancher quick-start doc can be found here.

However Rancher Server is incredibly easy to install. This one liner will do the trick:

$ sudo docker run -d –restart=unless-stopped -p 8080:8080 rancher/server
(WordPress messes up <dash><dash>restart in the line above)

Once Rancher Server and its UI are up and running, you’ll need to install Rancher Agent on each Docker host (including RancherOS hosts). The Rancher UI explains the process clearly and makes it easy.

Categories: Docker, Linux Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.