Docker advanced applications cluster and auto scale

Source: Internet
Author: User

The previous introduction of Docker's stand-alone installation, multi-host network interoperability, how to semi-automated update and rollback code, now describes how to cluster and auto scale.

Trunking Communication Software

This feature is written in the Python language and is based on TCP sockets and SSL encrypted communication. Let's look at the effect show:

To view all node information:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E4/wKiom1XaeJWSNMuEAAGbpvxDKSM937.jpg "title=" 11.png "alt=" Wkiom1xaejwsnmueaagbpvxdksm937.jpg "/>

(The software name is Cdocker, divided into the client and the service side, the name of the service is cdocker_server.py, the client name is cdocker_client.py, thank you for the name of Chen Li Food to help me)

The return information shows that the current cluster has 3 nodes (Node), storage location and type (Metadata), Machine Unique identification (Machines_id), the current host creates the number of containers (Container_now_user) and the maximum number of containers that can be used (Container_max_use)。

This program also includes some functions such as Mesos, which can calculate the available resources in the cluster, and show the specific usage and maximum usable quantity.

View container information in a specific node

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E1/wKioL1Xae0Lx8j_4AAMIfkjINPw007.jpg "title=" 11.png "alt=" Wkiol1xae0lx8j_4aamifkjinpw007.jpg "/>

Cluster module also has other functions, such as creating a cluster, creating Auto_scale, and so on, today I will show you the Web interface, background implementation is no longer detailed introduction.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E4/wKiom1XaeYGAgUA6AAKGdjkmXU0043.jpg "title=" 11.png "alt=" Wkiom1xaeygagua6aakgdjkmxu0043.jpg "/>

For the cluster overview interface, contains some information about the current cluster. You can create a cluster in the upper left corner:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E1/wKioL1Xae_6BwYJOAAJxn1vysG4915.jpg "title=" 11.png "alt=" Wkiol1xae_6bwyjoaajxn1vysg4915.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E1/wKioL1XafCSjGQi8AADfk5RTbUs699.jpg "title=" 11.png "alt=" Wkiol1xafcsjgqi8aadfk5rtbus699.jpg "/>

My basic idea for the storage area design is to select the type according to the configuration of the server. Specific as follows:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E4/wKiom1XaekCTHjfGAACey0JV8f0053.jpg "title=" 11.png "alt=" Wkiom1xaekcthjfgaacey0jv8f0053.jpg "/>

The Auto_scale start number and the maximum number of interfaces, as well as the memory, CPU threshold settings are very intuitive, no longer repeat.

Click the Info button to view cluster project information, instance information, public information, etc.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E4/wKiom1XaeoLwUeelAAK8Fcqc5KI520.jpg "title=" 11.png "alt=" Wkiom1xaeolwueelaak8fcqc5ki520.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E1/wKioL1XafLzACnGOAAGsy-_cTLw435.jpg "title=" 11.png "alt=" Wkiol1xaflzacngoaagsy-_ctlw435.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E1/wKioL1XafOnQZgfRAAI0811C8_8624.jpg "title=" 11.png "alt=" Wkiol1xafonqzgfraai0811c8_8624.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E1/wKioL1XafRDA7t-FAAE32fFZFFc732.jpg "title=" 11.png "alt=" Wkiol1xafrda7t-faae32ffzffc732.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E1/wKioL1XafX6CJrFsAAHI4kwo20o126.jpg "title=" 11.png "alt=" Wkiol1xafx6cjrfsaahi4kwo20o126.jpg "/>

The public network IP and firewall information can be dynamically adjusted.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E1/wKioL1XafbDB3LcHAAHQoeHMkAA685.jpg "title=" 11.png "alt=" Wkiol1xafbdb3lchaahqoehmkaa685.jpg "/>

The entry into force means that the new or modified firewall policy will take effect, mainly in the wrong operation.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E4/wKiom1Xae9DwjtcaAAFYifVgCYo590.jpg "title=" 11.png "alt=" Wkiom1xae9dwjtcaaafyifvgcyo590.jpg "/>

This 3 button is mainly to update the cluster, rollback (this feature is also a bit of a flaw, so don't show it first)

The following is an introduction to auto scale

Mainly through the self-research program docker_auto_scale.py Dynamic expansion and reduction of the number of containers, this program is to obtain the monitoring information of the cluster and the auto scale setting value with the CPU, The memory threshold is evaluated and the operation is performed after comprehensive judgment.

The effect is as follows

such as normal operation (CPU, memory usage not exceeding threshold)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E1/wKioL1Xaft2SuKlIAAHDcRE76N8099.jpg "title=" 11.png "alt=" Wkiol1xaft2sukliaahdcre76n8099.jpg "/>

Modify the memory threshold below

Before modification

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E1/wKioL1Xafy7C5Qn0AAJMQsUoSFg201.jpg "title=" 11.png "alt=" Wkiol1xafy7c5qn0aajmqsuosfg201.jpg "/>

After modification

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E5/wKiom1XafUXA4mKOAAGj8JmLxz0561.jpg "title=" 11.png "alt=" Wkiom1xafuxa4mkoaagj8jmlxz0561.jpg "/>

Click Submit

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E5/wKiom1XafXjh_2hTAAG2USsc998035.jpg "title=" 11.png "alt=" Wkiom1xafxjh_2htaag2ussc998035.jpg "/>

You can see that the memory threshold has been changed from 95% to 1%, the following is the case of running auto scale software

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E1/wKioL1XagACA_a5mAARCyMavqJQ122.jpg "title=" 11.png "alt=" wkiol1xagaca_a5maarcymavqjq122.jpg "/> can see the expansion of the current one times, from 4 to 8

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E5/wKiom1XafiHzZvxdAAOde8O-2ig562.jpg "title=" 11.png "alt=" Wkiom1xafihzzvxdaaode8o-2ig562.jpg "/>

Run it down here again

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E5/wKiom1Xafquh7kDlAAaUCAxkC7g620.jpg "title=" 11.png "alt=" Wkiom1xafquh7kdlaaaucaxkc7g620.jpg "/>

You can see that from 8 to 16, it turns up a double.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E1/wKioL1XagP6gdaXQAAUWr-7Ti5E866.jpg "title=" 11.png "alt=" Wkiol1xagp6gdaxqaauwr-7ti5e866.jpg "/>

In addition, Auto scale reduction is the same effect

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/71/E1/wKioL1XahnPCffY7AAk8SB6_-gc738.jpg "title=" 11.png "alt=" Wkiol1xahnpcffy7aak8sb6_-gc738.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/71/E5/wKiom1XahHzSQGt8AAI3Sh59YdU957.jpg "title=" 11.png "alt=" Wkiom1xahhzsqgt8aai3sh59ydu957.jpg "/>

This is only for the back-end operations, but the front-end access is definitely through the IP plus URL, and then load to the backend real server, I'm here to use the program +etcd+confd+haproxy+keepalived

The Web Access effect is

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/71/E1/wKioL1XagcaTPBeaAAWZGBCvD-E954.jpg "title=" 11.png "alt=" Wkiol1xagcatpbeaaawzgbcvd-e954.jpg "/>

The URL corresponding to the script is to get the container's intranet IP.

As for a few IPs containing this is test update I made the test myself.

At present, the cluster and auto scale mode can meet the dynamic expansion and reduction, which can be satisfied for the maximum use of resources, high availability and high availability across the room.


This article is from the "Yin-Technical Exchange" blog, please be sure to keep this source http://dl528888.blog.51cto.com/2382721/1687544

Docker advanced applications cluster and auto scale

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.