This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Docker Machine
satrapu edited this page Oct 14, 2017
·
4 revisions
This page details how to run Rancher server and 2 agents on VMs created via Docker Machine.
This is the approach to be used during this workshop!
This OS was built specifically for hosting Docker containers and it's officially supported by Rancher server.
- RancherOS Home: http://rancher.com/rancher-os/
- RancherOS Official Documentation: http://rancher.com/docs/os/v1.0/en/
- This workshop will use RancherOS v1.0.4, available here: https://releases.rancher.com/os/v1.0.4/rancheros.iso
- Latest version can be found here: https://releases.rancher.com/os/latest/rancheros.iso
- All versions can be found here: https://github.com/rancher/os/releases
You can control a RancherOS instance via ros command:
$ sudo ros
# NAME:
# ros - Control and configure RancherOS
#built: '2017-08-08T00:05:15Z'
#
#USAGE:
# ros [global options] command [command options] [arguments...]
#
#VERSION:
# v1.0.4
#
#AUTHOR(S):
# Rancher Labs, Inc.
#
#COMMANDS:
# config, c configure settings
# console manage which console container is used
# engine manage which Docker engine is used
# service, s
# os operating system upgrade/downgrade
# tls setup tls configuration
# install install RancherOS to disk
# selinux
# help, h Shows a list of commands or help for one command
#
#GLOBAL OPTIONS:
# --help, -h show help
# --version, -v print the version
More information can be found here and here.
On Windows, please run docker-machine as admin!
docker-machine create -d virtualbox --virtualbox-boot2docker-url https://releases.rancher.com/os/v1.0.4/rancheros.iso --virtualbox-cpu-count 2 --virtualbox-memory 2048 --virtualbox-disk-size 10000 rs
docker-machine create -d virtualbox --virtualbox-boot2docker-url https://releases.rancher.com/os/v1.0.4/rancheros.iso --virtualbox-cpu-count 2 --virtualbox-memory 2048 --virtualbox-disk-size 20000 ra1
docker-machine create -d virtualbox --virtualbox-boot2docker-url https://releases.rancher.com/os/v1.0.4/rancheros.iso --virtualbox-cpu-count 2 --virtualbox-memory 2048 --virtualbox-disk-size 20000 ra2
In order to obtain the IP address of a VM created via docker-machine, run the following command:
# Solution #1
docker-machine ip <DOCKER_MACHINE_NAME>
# Solution #2
docker-machine inspect <DOCKER_MACHINE_NAME> --format={{.Driver.IPAddress}}
docker-machine ssh rs
docker-machine ssh ra1
docker-machine ssh ra2
In case your Rancher server is keep showing an error page, check the rs machine logs. You might see:
...
time="2017-08-20T16:29:03Z" level=info msg="Starting Catalog Service (port 8088, refresh interval 300 seconds)"
fatal error: runtime: out of memory
...
If this is the case, you may want to allocated more RAM to this machine.
# stop VM
docker-machine stop <DOCKER_MACHINE_NAME>
# set number of CPU cores
VBoxManage modifyvm <DOCKER_MACHINE_NAME> --cpus 2
# set amount of RAM in MB
VBoxManage modifyvm <DOCKER_MACHINE_NAME> --memory 4096
# start VM
docker-machine start <DOCKER_MACHINE_NAME>