Rancher Quick Start Guide operation (1)

Source: Internet
Author: User
Tags docker ps docker hub

Rancher Quick Start Guide operation (1)
This guide knows how users can quickly deploy the rancher Server management container.
The premise is to assume that your machine is already installed Docker.
1 confirm the version of Docker, the following is the output of Ubuntu

[#63 #[email protected] ~] $sudo Docker Version[sudo] password for cloudsoar:client:version:1.9.1 API version:1.21 Go version:go1.4.3 Git commit:a34a1d5 built:fri Nov 17:56:04 UTC os/arch:linux/amd64 server:v ersion:1.9.1 API version:1.21 Go version:go1.4.3 Git commit:a34a1d5 built:fri Nov 17:56:04 UTC 20 Os/arch:linux/amd64

2 Confirm that the Docker service is started

[#64 #[email protected] ~] $sudo service Docker status Docker.service-docker application Container engine & nbsp; loaded:loaded (/lib/systemd/system/docker.service; disabled; vendor preset:enabled)     Active:inactive (dead)      docs:https://docs.docker.com [#9 #[email protected ] ~] $service   Docker start==== authenticating for Org.freedesktop.systemd1.manage-units ===authentication  Is required to manage system services or units. Authenticating as:cloudsoar,,, (cloudsoar) password: [#10 #[email protected] ~] $service   Docker Status Docker.service-docker application Container engine   loaded:loaded (/lib/systemd/system/ Docker.service; Disabled Vendor preset:enabled)    active:active (running) since three  2016-03-16 13:48:08 CST; 3s ago     docs:https://docs.docker.com main pid: 10526  (docker)    &nbsp CGroup:/system.slice/docker.service           └─10526  /usr/bin/docker daemon-h fd://

When I use sudo docker status to observe, I notice that the Docker service does not start and calls the service do manually

Cker start. Then look again and see that the status is running.

3 Starting the Rancher server

The Rancher server is a docker image, so the software itself does not need to be installed, only the Docker

Download and successfully run the Docker server image.

[#13 #[email protected] ~] $sudo docker run-d--restart=always-p 8080:8080 rancher/serverunable to find  image  ' Rancher/server:latest '  locallylatest:pulling from Rancher/serverd46dba346816:pulling FS Layera2851d201e25:pulling FS layerb262e58356c2:pulling FS layerceffdc5777c7:pulling FS Layera28d44434980:pulling fs LA Yerf800a1597427:pulling FS Layer60af5060daf4:pull completeb1dd93d5a711:pull Complete0d7dfe35cf6a:pull Complete58e93f0715e7:pull completea9dbd765bf44:pull Complete4bfcf74f9624:pull Completed330fcc1e464:pull Complete3da33c2536ae:pull complete95241837a38f:pull Completeec54f4e41d98:pull Completecdc934c804b3:pull Completeab8a261178e3:pull complete89833fcf633e:pull Complete7df15d047ef2:pull Complete2c5bb9b85b2e:pull Complete2517d3de4cde:pull completedca61fda9ea4:pull Complete8566ccc2c63c:pull Complete720ffa009a71:pull Complete3c65bd6b0c6d:pull completef8b5f2d5eebe:pull complete9c495859a0e4:pull complete20bee38968e6:pull compleTef80a8ea9cd3e:pull Completec9c864eb9bef:pull completedigest:sha256 : 989c47a7eb94352826f420c48ec4d0343ef43aee83d619bfa064f1642f1811fbstatus:downloaded Newer image for  rancher/server:latest1613c4b9d70d6f39a82e6148a0ce08422cef3541de19de5d68dfed22196c4076

Command-line argument explanation:

The-d parameter of the Docker run runs in the background, and the--restart=always container restarts automatically if the exception is stopped. -P

8,080:8,080 port 8080 of the UI external Service (container) of the Rancher server, bound to the host's

8080 ports. followed by the image name Rancher/server, Docker will first check if there is a local mirror,

If not, Docker will go to the Docker Hub to download the image and launch it.

I've downloaded it for almost one hours.

4 Check if the Rancher/server image is downloaded correctly

[#15 #[email protected] ~] $sudo Docker imagesrepository                   tag                  IMAGE id             created             VIRTUAL SIZEubuntu                        latest              001d664e2dd4         7 hours ago         188 mbzhiyewang/apache2           latest               e9c0ce8fc3ae         Hoursago        244.6 mbrancher/server               latest               c9c864eb9bef        hours ago         768.2 mbpaulcos11/docker-tutorial   latest               e37931352714        9 Days ago           587.8 mbfedora                       latest               9bdb5101e5fc        11 Days ago         204.7 mbubuntu                      14.04                8ed581e3fa7a         ago         188 mbhello-world                  latest               0a6ba66e537a        5 months ago        960 B

Can see that I have successfully downloaded here.

5 Check if the Rancher server container is running properly

[#17 #[email protected] ~] $sudo Docker Ps-acontainer id        IMAGE                command                   created              status         PORTS                                names1613c4b9d70d         rancher/server       "/usr/bin/s6-svscan/"    5 Minutes ago       up 5 minutes   3306/tcp, 0.0.0.0:8080->8080/tcp    modest_bell042ff0ac2af7        zhiyewang/apache2     "/bIn/bash "              20 minutes ago       up minutes  Elated_hoover

6 opening the Rancher Server container UI interface with a browser

[#20 #[email protected] ~] $ifconfigeth 0 Link ENCAP: Ethernet Hardware address 00:0c:29:72:dc:f7 inet address: 192.168.2.28 Broadcast: 192. 168.2.255 Mask: 255.255.255.0 inet6 Address: fe80::20c:29ff:fe72:dcf7/64 scope:link up broadcast RUNNING multic AST mtu:1500 Hops: 1 Receive packet: 571758 Error: 0 Discard: 0 Overload: 0          Number of frames: 0 Send packet: 335098 error: 0 Discard: 0 Overload: 0          Carrier: 0 Collisions: 0 Send Queue Length: 1000 Receive bytes: 620330947 (620.3 MB) Send bytes: 125962556 (125.9 MB)

Can see the IP of my host is 192.168.2.28, before we will Rancher Serv through the Docker Run command

The 8080 port of the ER container is bound to the 8080 port of the host. To access the Web page inside the container, you can enter the

The IP and port of the main machine.

7 Rancher Server Configuration

7.1 Add an Account

For the first time, you have not configured access, for security, first click on the above access CONTROL to create a new

A local account and password.

Enter the account number and password you want to set

Click Enable Local Authentication to open authentication locally, and next time you need to enter your username and password to log in.

7.2 Log Observations

Open a separate terminal, opening the log output of the Rancher Server container, observing:

The command is: sudo docker logs-f container ID

7.3 Adding a host

Host is Rancher working node, similar to server virtualization Hypervisor, we now do all-in-one test

, add the host to the Rancher node host.

Select Applications below the ADD Host, the Popup interface select Custom, the 4th step of the page appears in the

Copy and paste it down. The command line that gets the host is executed.

7.4 Installing the Rancher Agent

Copy the above command to the host to paste execution

[#26 #[email protected] ~] $sudo docker run-d--privileged-v/var/run/docker.sock:/var/run/docker.sock-v/var/lib/ Rancher:/var/lib/rancher rancher/agent:v0.10.0 Http://192.168.2.28:8080/v1/scripts/D7A384BCBAC6FF19B5FC : 1458111600000:jftgk9cnkzfy5izvqm9kinyrmuw[sudo] Password for cloudsoar:unable to find image ' rancher/agent:v0.10.0 ' Locallyv0.10.0:pulling from rancher/agentb3efe11ed0e2:downloading 526.1 kb/65.69 MB

The rancher/agent image is downloaded and run automatically. Wait for the download to complete.

Look at the process, one more rancher/agent process, and it's already running.

At this point, go back to the Web page to view the console interface and see the results after the Host was added.

You can see that there is already an active host (host), which runs a Rancher Server container, which is Ranc

Her server herself. If you have other hosts, you can also add other hosts to come in.

8 running a container through the Web UI

The container is now run through the graphical interface, not through the command line.

8.1 Adding a container

In the INFRASTRUCTURE tab select CONTAINERS, select Add Container

1 Enter First_container as the container name

2 using the default Ubuntu 14.04.3 image

3 Click the Create button


Click Create.

After a few seconds, you can see an extra first_container container and a Network Agent. First_container

As a container created by this test.

Which of the following network Agent functions is the communication between the user hosts.

1 Click the Down button on the menu of the new Ubuntu container

2 Select the Run Shell option in the Web page


You can then operate the container here. If you prefer the CLI command line, you can go directly to the host's command-line operation.

Rancher Quick Start Guide operation (1)

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.