Practice Guide-Quick Unlock Rancher v1.2

Source: Internet
Author: User
Tags virtualbox download

Original source: Rancher Labs Introduction

Rancher v1.2 has been released, I believe that many container rivers and lakes partners are the Magic fist rub ready to experience some. Since Docker can fall into many operating systems and different Docker versions of graph driver, the first release of a large version usually has some minor compatibility problems. In order to better experience the complete characteristics of rancher v1.2, we selected the rancher test more stringent operating environment. The devops who hold many server resources can float through this article, the sales/pre-sales of the back of MBP or Windows notebook can read some goods. Basic Software Installation

First you need to install the basic software, because the rancher v1.2 already supports Docker v1.2, so you can directly use the Docker Mac or Windows version (take the Mac as an example) and download the address:
https://www.docker.com/. On the Mac, Docker will use Xhyve lightweight virtualization to ensure a Linux environment, so you can run the rancher server directly.

Because you want to add multiple host groups to the MBP, you need to add multiple nodes to the rancher cluster with virtualization extensions. Here you can use Docker-machine control VirtualBox to add nodes, VirtualBox download address: https://www.virtualbox.org/wiki/Downloads.

On the host node's operating system, you can choose Rancheros, our goal is to quickly experience the new features, and rancher labs in rancher and Rancheros compatibility is done a lot of testing, so that we can avoid less into the pit, directly experience the new features. Rancheros Download Address: Https://github.com/rancher/os, recommended to use the latest release version.

When creating a host with the Docker-machine driver VirtualBox, you can specify the URL path for the operating system ISO, and since we use Rancheros, it is best to put rancheros in the native HTTP server. Within the MBP with Apache HTTPD, the Apache vhosts module is opened and added configuration:

# Open vhost/etc/apache2/httpd.conf
# The default annotation for the following two lines removes
LoadModule vhost_alias_module libexec/apache2/mod_vhost_ alias.so
include/private/etc/apache2/extra/httpd-vhosts.conf

# vhost Configuration/etc/apache2/extra/ httpd-vhosts.conf
# DocumentRoot directory is created in the user root directory Sites
# such as user name Niusmallnan, then DocumentRoot is/users/niusmallnan/ Sites
<virtualhost *:80> 
    documentroot "/users/niusmallnan/sites" 
    ServerName localhost ErrorLog "/private/var/log/apache2/sites-error_log" 
    customlog "/private/var/log/apache2/sites-access_log" 
    Common 
    <directory/> 
        Options Indexes followsymlinks multiviews allowoverride 
        None 
        Order Allow,deny 
        allow to 
        Require all granted 
    </Directory>
</VirtualHost>

# restart Apache
$ sudo apachectl restart

# copy Rancheros ISO to documentroot
$ cp Rancheros.iso/users/nius mallnan/sites/
Rancher Installation

First open the Docker and configure registry mirror, and restart Docker after the configuration is complete. Mirror services can go to the various public cloud vendors to apply for one, such as I use here is Aliyun registry mirror, as shown in the figure:

Open terminal and install rancher Server:

To add a host node, you need to create a host through Docker-machine, where the specification is 2 core 2G (specific to the performance of its own MBP), and the script (add_ros_host.sh) is as follows:

#!/usr/bin/env bash
ros_iso_url= ' http://127.0.0.1/rancheros.iso ' 
ros_cpu_count=2 
ros_memory=2048 
docker-machine create-d virtualbox \
        --virtualbox-boot2docker-url $ROS _iso_url
        Virtualbox-cpu-count $ROS _cpu_count \
        --virtualbox-memory $ROS _memory \
        $ 
docker-machine ls  

To add a node you need to perform:

$./add_ros_host.sh ros-1

After the addition is complete, you can enter the virtual machine to set up:

$ docker-machine ls
NAME  ACTIVE DRIVER     State     URL                       SWARM Docker ERRORS ros-1 
-      VirtualBox Running   tcp://192.168.99.100:2376       v1.12.3

# into VM
$ docker-machine ssh ros-1
# Rancheros Set registry Mirror
$ sudo ros config set rancher.docker.extra_args \
        "['--registry-mirror ', ' HTTPS ://s06nkgus.mirror.aliyuncs.com '] "
$ sudo system-docker restart Docker

Since we are using a VirtualBox virtual machine to form a small cluster, we recommend that the rancher host registration URL be set to http://192.168.99.1:8080, as shown in the following illustration:

Add rancher AGENT When also note that the CATTLE_AGENT_IP parameter to set into a virtual machine 192.168.99.0/24 network segment IP, as shown in the following figure:

So you can basically completely unlock the various functions of rancher v1.2, complete demonstration of various features. Summary

Docker current version of a large number of branches, although the latest v1.13 will be released, but the use of each company version should be said to cover the v1.9 to v1.12, and Docker graph driver There are many, plus a lot of linuxos, It can be said that the use of Docker to produce a combination of many kinds, this will bring a variety of compatibility issues, resulting in a production environment failure can be a headache. Of course, if it is purely based on demo and research new features, we can prioritize better compatibility options.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.