Rancher is a Docker clustered management platform, and the rancher deployment management is very simple and convenient relative to the Mesos and k8s architectures. and feature-rich. The following is a diagram of the logical architecture I draw.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/75/F9/wKiom1ZF--_yvZoQAAKomeiG4e0421.png "title=" 7.png " Width= "735" height= "413" border= "0" hspace= "0" vspace= "0" style= "width:735px;height:413px;" alt= "wkiom1zf--_ Yvzoqaakomeig4e0421.png "/>
1: Deploy the Rancher management platform
Planning:
server:10.64.5.184
agent1:10.64.5.185
agent2:10.64.5.186
agent3:10.64.5.187
agent4:10.64.5.188
Deployment method:
Docker Container Launch
Server-side Deployment
Dependent Mirrors: Rancher/server:latest
# docker run-d--restart=always-v/home/heqinqin/data:/var/lib/mysql-p 8080:8080 rancher/server
Agent Deployment
Dependent Mirrors: rancher/agent:v0.8.2
To access server_ip:8080, click Add Host to add host to server-side management by executing the Add host command generated from the sever management side.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/75/F7/wKioL1ZGAX-QMz1tAAEObmjsGbg257.png "title=" 8.png " Width= "735" height= "420" border= "0" hspace= "0" vspace= "0" style= "width:735px;height:420px;" alt= " Wkiol1zgax-qmz1taaeobmjsgbg257.png "/>
After adding two host
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/F7/wKioL1ZGBBbz3cZXAACpKvrpWic837.png "title=" 1.png " alt= "Wkiol1zgbbbz3czxaacpkvrpwic837.png"/>
2: Deploy stack and service
Rancher Management container is a stack for a task group, under the stack can have multiple services to provide business together, and each service can contain multiple containers.
Below to create a Web cluster to provide Web services
1: Create a stack, named Web-server
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/75/F7/wKioL1ZGCBuj62eHAABSpKM3lhc799.png "title=" 10.png "Width=" 735 "height=" 404 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:735px;height:404px; "alt=" Wkiol1zgcbuj62ehaabspkm3lhc799.png "/>
2: Create a service, named Nginx-cluster, to run 10 nginx containers.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/75/F7/wKioL1ZGB7TTAj2iAABXGluFhBU686.png "style=" width : 735px;height:381px; "title=" 2.png "width=" 735 "height=" 381 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1zgb7ttaj2iaabxglufhbu686.png "/>
3: Click Start to start the service and start deploying container.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/75/F7/wKioL1ZGB7XyvE5MAAB-pwUx8dU678.png "style=" float: none; "title=" 3.png "alt=" Wkiol1zgb7xyve5maab-pwux8du678.png "/>
4: Create a Load balancer balance
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/F7/wKioL1ZGB7aicku_AADQWd-jtZA536.png "style=" width : 735px;height:497px; "title=" 4.png "width=" 735 "height=" 497 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiol1zgb7aicku_ Aadqwd-jtza536.png "/>
5: Create a Load balancer, set port mappings, and select load-balanced services for balance.
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/75/F7/wKioL1ZGB7eyllKdAACl-OPuFCE834.png "style=" width : 735px;height:497px; "title=" 5.png "width=" 735 "height=" 497 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiol1zgb7eyllkdaacl-opufce834.png "/>
6:web-server Service creation was successful. A stack consists of two service. 650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/75/F9/wKiom1ZGB2zzndB7AAElppQy7ZA495.png "style=" width:735px;height:422px; "title=" 6.png "width=" 735 "height=" 422 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1zgb2zzndb7aaelppqy7za495.png "/>
7: Click to display the schema diagram, you can clearly see the logical relationship.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/75/F7/wKioL1ZGCjuxoZgCAAFQeP50V00072.png "title=" 7.png " Width= "735" height= "510" border= "0" hspace= "0" vspace= "0" style= "width:735px;height:510px;" alt= " Wkiol1zgcjuxozgcaafqep50v00072.png "/>
8: Similarly create a WordPress service, as follows.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/75/F9/wKiom1ZGCk_RcSSlAADAfsbWnmg937.png "style=" width : 735px;height:236px; "title=" 11.png "width=" 735 "height=" 236 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" wkiom1zgck_ Rcsslaadafsbwnmg937.png "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/75/F7/wKioL1ZGCpzBdnUjAADd2NbB5No097.png "style=" float: none; "title=" 12.png "alt=" Wkiol1zgcpzbdnujaadd2nbb5no097.png "/>
3:rancher related features, functions
Dependent Mirrors: rancher/agent-instance:v0.5.0
Using the SDN technology, the container is a virtual IP address 10 segment (normally Docker internal address 172), the container between the hosts uses IPSec tunneling for cross-host communication, using UDP 500 and 4500 ports.
When you start a task, a network agent container is set up before each host deployment container, which is responsible for building the networking environment.
Includes: Host monitoring + and container monitoring
Monitoring content: Cpu+memory+network+storge
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/F9/wKiom1ZGDOzTyjmCAAFk6YpsqZs066.png "title=" 13.png "Width=" 735 "height=" 263 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:735px;height:263px; "alt=" Wkiom1zgdoztyjmcaafk6ypsqzs066.png "/>
Supports multiple access control rights management. ensure platform security.
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/75/F9/wKiom1ZGDSOTM2aGAADBsnQkSAc508.png "style=" width : 735px;height:221px; "title=" 14.png "width=" 735 "height=" 221 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1zgdsotm2agaadbsnqksac508.png "/>
Supports user groups and permissions settings (such as setting up an OPS environment and developing the dev environment for administrative isolation).
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/75/F9/wKiom1ZGDSTTi42OAAB376K8th0584.png "style=" width : 735px;height:212px; "title=" 15.png "width=" 735 "height=" 212 "border=" 0 "hspace=" 0 "vspace=" 0 "alt=" Wkiom1zgdstti42oaab376k8th0584.png "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/75/F9/wKiom1ZGDeHBbLRxAAGUM2RLpaQ961.png "title=" 16.png "Width=" 735 "height=" 371 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:735px;height:371px; "alt=" Wkiom1zgdehbblrxaagum2rlpaq961.png "/>
4: Destructive Testing
Server is run in a fat container, which contains the MySQL database, tested, the database holds the task data and the task logic relationship.
Destroying the server side
1.
Operation: In the server side and the agent side of normal operation, stop off the server container,
The result: the business is unaffected. Start to restart the container after the recovery management function.
2.
Action: Remove the server-side container rm (the MySQL data is not mapped to the host) and restart the server container.
Results: 1. Current business not affected
2. The new server will still be able to identify and manage the agents, because the agent side is the IP port of the server, IP will be able to connect
3.agent the original task container naming and logical relationships are gone.
3.
Action: Remove the server-side container rm (map MySQL data/var/lib/mysql to the host) and restart the server container.
Result: The new container can identify task status, naming, and logical relationships. Revert to the previous state.
Destroy Agent Side
4.
Action: Remove agent container under host command line
Results: Without affecting the current business status, the server side shows that host is missing, and the agent cannot be assigned to expand and shrink the task.
Returns to normal after restarting the agent.
5.
Action: The server control side removes the agent-side business container (for example, delete Nginx container)
Result: A new business container is restarted on another host within seconds of deletion.
6.
Action: Delete the agent-side business container (for example, delete Nginx container) under the host command line
Result: A new business container is restarted on the current host within a few seconds of deletion.
7.
Action: Remove the agent container after the host command line, then delete a business container
Result: The server side failed to update the container changes on the host because it was not associated with the agent, and no new containers were started.
Test not finished ...
---current conclusions
1:server nodes need to be deployed separately and relatively high performance is given.
2:server node outages do not affect existing business, but may impact post-management.
3: The server side data needs to be saved to the host, and the database data is backed up regularly.
4:server end of the host management is entirely dependent on the agent container, when unable to contact the agent container, can not know the current host on the changes in the container, the terminal is displayed in the last Agent notification content state.
This article is from the "8931355" blog, please be sure to keep this source http://8941355.blog.51cto.com/8931355/1712683
Rancher clustered Docker Management platform deployment, features, and destructive testing.