Tutorial

RancherOS Installation

Environment Preparation

  • Prepare xshell and xftp clients (before installing xManager).
  • Burn rancheros.iso to CD or U disk to make system disk.

Install RancherOS

Startup

Plug the system disk into the host and turn on the power for installation. After startup, set the temporary account password at the command line as follows:

sudo passwd rancher

Enter a new password two times when the prompt appears, for example: supermap

Set Network

Check the network:

  1. Check the host IP through Ifconfig. if you can see the eth0 item, continue the next step; otherwise please contact technical support staff.
  2. Check whether the host has been assigned to IP. The ip needs to be configured as in the following figure if eth0 does not have the inet addr item. If the host has been assigned to IP, you do not need to configure any more.

image10

Add IP commands as follows: ({IP} is a temporary IP that will be configured, please contact your network administrator to get it)

sudo ip addr add {ip} dev eth0

image11

Check results via Ifconfig after Setup is successful:

image12

Modify the rancheros_config.yml file:

Find rancheros_config.yml in Attachments and open it. If you use DHCP to assign ip, you only need to set dhcp to true, as shown below:

image13

If you are not using DHCP, you need to set ip by yourself (please contact the network administrator to get it), as shown below:

image14

Upload YML File

Log on to the host with xshell. For ip and password, please refer to the 1st and 2nd step.

Input ssh rancher@{ip} in the xshell command line, select “password” in the “ssh User Authentication” in the dialog box that displays, enter the password and click OK. {ip} is the host ip

Now, yu can connect to the host with xshell.

After login, click on the New File Transfer in the upper right corner, and upload the local rancheros_config.yml file to the Docker host via xftp.

Check Local Disk

Perform the following command to view the local disk:

sudo fdisk ‐l

Select the largest disk to install the system system. In the following example, select /dev/sda.

image15

Install Operating System

Use the following command to install the system: (where /dev/sda is the name of the disk with the maximum space selected for the previous step, the login password)

sudo ros install ‐c rancheros_config.yml ‐d /dev/sda ‐‐append 'rancher.password='

Example:

image16

During the installation, you will be prompted two times. You can select Y, and the system will be restarted after the installation is completed.

Log In

After the system restarts, the temporary account password set in step 1 will expire. You can use the login password set in step 5 to log on to Xshell or directly log on to the host.

Hos log in:

Fill in the username and password in Supermap login (user name is “rancher”)

image17

Run docker -v, you will find Docker has been installed

docker ‐v

The remote port opened for Docker is 2375. You can run the command below for the verification:

docker ‐H :2375 info

Install Docker-compose

Use xftp to upload docker-compose.sh and docker-compose.tar to the Docker host.

Run command:

sudo docker load ‐i ./docker‐compose.tar
sudo chmod +x ./docker‐compose.sh

When installation of DockerCompose finished, run the command below for verification:

./docker‐compose.sh ‐v

Notes:
Use ‘./docker-compose.sh’ instead of ‘docker-compose’ command for execution.

FAQ

Q: What if the IP that is configured in rancheros_config.yml file can not connect to the network?

A: Modify the network configuration using the following command:

Modify ip to your real ip:

sudo ros config set rancher.network.interfaces.eth0.address {ip}

Modify gateway to your eal gateway:

sudo ros config set rancher.network.interfaces.eth0.gateway {getway}

Example:

image18

Restart to make the configuraiton take effect.