In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to redundant docker network in DDBMS, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Environmental preparation:
Configure four ubuntu server 14.04s in vmware (you can install only one system and clone the other three ubuntu using the cloning feature) and configure SSH
Each machine is equipped with two network cards, like openstack, divided into Internal and External IP. Here I let eth0 (NAT) as External,eth2 (host-only) as Internal.
The topology diagram is as follows:
Install OVS:
For specific installation tutorials, please see here: http://www.sdnlab.com/3166.html
Attach my OVS startup script:
OVS launch launchgear certificate=db:Open_vSwitch,SSL,certificate certificate=db:Open_vSwitch,SSL,certificate-- bootstrap-ca-cert=db:Open_vSwitch,SSL launch the ovsovsdb-server-v-- remote=punix:/usr/local/var/run/openvswitch/db.sock-- remote=db:Open_vSwitch,Open_vSwitch,manager_options-- certificate=db:Open_vSwitch,SSL,certificate-- bootstrap-ca-cert=db:Open_vSwitch,SSL Ca_cert-- pidfile-- detach#init the databaseovs-vsctl-- no-wait init#launch the main processovs-vswitchd-- pidfile-- detach#print the version infomationovs-vsctl-- versionecho echo 'OpenVswitch have been launched fulfilling'
Save and place the script
Chmod + x ovs_launchmv ovs_launch / usr/local/bin
Install the pipework tool:
Git clone https://github.com/jpetazzo/pipeworkcp ~ / pipework/pipework / usr/local/bin/
Install the latest version of docker: https://docs.docker.com/installation/ubuntulinux/
Pull an image:
Docker pull ubuntu
Create br0 and br1 bridges for mounting containers:
Brctl addbr br0ip link set dev br0 upip addr add 192.168.2.1/24 dev br0brctl addbr br1ip link set dev br1 upip addr add 192.168.3.1/24 dev br1
Configure OVS on each host (execute ovs_launch first every time you boot):
Ovs-vsctl add-br ovs0ovs-vsctl set bridge ovs0 stp_enable=trueovs-vsctl add-port ovs0 br0ovs-vsctl add-port ovs0 br1
Create a vxlan or gre tunnel for host1tohost2 (I use gre here):
Ovs-vsctl add-port ovs0 gre0-set interface gre0 type=gre options:remote_ip=10.20.10.71
Create a gre tunnel for host2tohost1:
Ovs-vsctl add-port ovs0 gre0-set interface gre0 type=gre options:remote_ip=10.20.10.70
Create a tunnel for host2tohost3:
Ovs-vsctl add-port ovs0 gre1-set interface gre1 type=gre options:remote_ip=10.20.10.72
Create a tunnel for host3tohost2:
Ovs-vsctl add-port ovs0 gre1-set interface gre1 type=gre options:remote_ip=10.20.10.71
Create a tunnel for host3tohost4:
Ovs-vsctl add-port ovs0 gre2-set interface gre2 type=gre options:remote_ip=10.20.10.73
Create a tunnel for host4tohost3:
Ovs-vsctl add-port ovs0 gre2-set interface gre2 type=gre options:remote_ip=10.20.10.72
Create a tunnel for host4tohost1:
Ovs-vsctl add-port ovs0 gre3-set interface gre3 type=gre options:remote_ip=10.20.10.70
Create a tunnel for host1tohost4:
Ovs-vsctl add-port ovs0 gre3-set interface gre3 type=gre options:remote_ip=10.20.10.73
(note that the interworking tunnel name between the two hosts is the same, and no tunnel with the same name can appear on each OVS)
Start the container and test:
Host1:
Docker run-itd-- name=test1 ubuntupipework br0 test1 192.168.2.11 Universe 24
Host2:
Docker run-itd-- name=test1 ubuntupipework br0 test1 192.168.2.12 Universe 24
Host3:
Docker run-itd-- name=test1 ubuntupipework br1 test1 192.168.3.11 Universe 24
Host4:
Docker run-itd-- name=test1 ubuntupipework br1 test1 192.168.3.12 Universe 24
When you enter the container for testing, you will find that no matter which container is hung on the same br bridge (the same network segment), they are interoperable. Of course, it's absolutely impossible if you use 192.168.2.11 ping 192.168.3.11 (unless you don't hang br0 and br1 on ovs0, route will route, in which case it can be interconnected).
At this point, you have established a redundant network of docker containers.
The above is all the contents of the article "how to redundant docker Networks in DDBMS". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.