Prepare overlay Network Experiment Environment-5 minutes a day to play Docker container technology (+) _docker

Source: Internet
Author: User
Tags prepare docker run

To support container Cross host communication, Docker provides overlay driver, allowing users to create overlay networks based on Vxlan. Vxlan can encapsulate two-tier data into UDP for transmission, Vxlan provides the same Ethernet two-tier service as the VLAN, but with greater scalability and flexibility. More detailed information about Vxlan can be referenced in the relevant chapters of Cloudman's 5-minute play OpenStack every day.

Docerk Overlay network requires a Key-value database to hold network state information, including network, Endpoint, IP, etc. Consul, ETCD and zookeeper are all Docker-supported Key-vlaue software, and we use consul here. Description of the experimental environment

We will directly use the experimental environment created by the previous chapter Docker-machine. Implement a variety of cross-site networking scenarios on the Docker host Host1 (192.168.56.104) and Host2 (192.168.56.105), deploying supported components on the 192.168.56.101, such as consul.

The easiest way to do this is to run the consul in a container:

Docker run-d-P 8500:8500-h Consul--name consul Progrium/consul-server-bootstrap

After the container is started, you can access consul through http://192.168.56.101:8500.

Next, modify the configuration file/etc/systemd/system/docker.service for host1 and Host2 Docker daemon.

--CLUSTER-STORE Specifies the address of the consul.
--cluster-advertise tells consul his or her connection address.

Restart Docker daemon.

Systemctl Daemon-reload

Systemctl Restart Docker.service

Host1 and Host2 are automatically registered in the consul database.

Ready, the experimental environment is as follows:

The next section creates a overlay network.

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.