1. Swarm is a scheduling framework developed by docker.
(Found on the Internet)
2.Server Load balancer: Docker is called ingress load balancing ). It works by listening to published service ports on all worker nodes. When the service is called by an external system, the node that receives the traffic will use the internal DNS service provided by
Preparing the installation package1. Download DockerDocker supports the following versions of Ubuntu systemArtful 17.10 (Docker CE 17.11 Edge)Zesty 17.04Xenial 16.04 (LTS)Trusty 14.04 (LTS)View Ubuntu system version: sudo lsb_release–aDownload the corresponding Docker installation package: https://apt.dockerproject.org/repo/pool/main/d/docker-engine/2. Download
: -"5000:80" Links: -Weba -Webb Weba: image:testweb# build:# Context:. # Dockerfile:dockerfile expose: -"page" Links: -Redis Webb: Image: testweb# build:# context:. # Dockerfile:dockerfile expose: -"About" Links: - Redis Redis: image:redis expose: -6379For the sake of convenience, I first performed the Dockerfile file above to create a mirrored testweb and Nginx mirror Testnginx for a. NET core
First, create a cluster1. Initialize the manager node (XXX is the manager's IP address)docker swarm init --advertise-addr xxx.xxx.xxx.xxxWill output the following, note Bold Italic command, join the cluster need to use
Swarm initialized:current Node (pk4p936t4e03cpse3izuws07s) is now a manager.To add a worker to this
10.40.100.145 onDocker run-d--name consul0--restart=always-v/mnt:/data \- P 8300:8300 \- P 8301:8301 \- P 8301:8301/udp \- P 8302:8302 \- P 8302:8302/udp \- P 8400:8400 \- P 8500:8500 \docker-registry.venic.com:5000/consul:latest-server-advertise 10.40.100.145-bootstrap-expect 310.40.100.146 onDocker run-d--name consul1--restart=always-v/mnt:/data \- P 8300:8300 \- P 8301:8301 \- P 8301:8301/udp \- P 8302:8302 \- P 8302:8302/udp \- P 8400:8400 \- P 8
Balance the advance, first make a prototype it.#!/usr/bin/env python#-*-coding:utf-8-*-ImportRequestsImportJSON#Define the Management node IP, port number, API version, service name, service URL of docker swarm#in late integration into automated deployments, data structures need to be streamlined, data is refined, and accurate judgment and space reclamation are added#API For more use reference: https://docs
When using Swarm's overlay network, run the Container Times "network xx not manually attachable" error in the WebDocker Network create-d Overlay--attachable My-attachable-overlayNetworks created by default with Docker network create-d overlay NET can only be used by swarm service and need to be added--attachable option if required to be used by a separate containerDocker Network create-d Overlay--attachable
This is a creation in
Article, where the information may have evolved or changed.
Docker Swarm manageThe options of the command are filter used to specify scheduler Docker Engine the selected filter, whose variables are defined as follows ( cli/flags.go ):
// hack for go vetflFilterValue = cli.StringSlice(filter.List())// DefaultFilterNumber is exportedDefaultFil
This is a creation in
Article, where the information may have evolved or changed.
Docker Swarm manageThe commands scheduler are built with filter and strategy ( cli/manage.go ):
sched := scheduler.New(s, fs)
schedulerthe actual function is to select cluster.ContainerConfig a list that meets the requirements node ( Docker Engine ):
// SelectNodesForContainer will
# # Visualizer Very visually shows the container load on each Docker host in the Swarm cluster,
# # Shipyard and Visualizer will take 8080, 5000 ports# # should be planned, avoid the use of these two ports, I in the code should be 8088 ports# # The following code has been tested properly
# # The Access address in this example: http://IP:8088
# # Run the following service creation command on the managemen
BackgroundPreviously, the service was created on different servers (Docker host) using Docker swam, and the container between them was communicated through overlay network. Yesterday due to the company's network maintenance, one of the servers (we referred to as manager node) due to maintenance, temporarily unable to connect (probably lasted 6 hours). Come back today, we found that the communication between
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.