Windows leverages swarm native Docker cluster Pit summary

Source: Internet
Author: User
Tags docker swarm

Environment:

Role Machine name Operating system Ip Note
mater web30 windows Server GUI 192.168.2.30 Install the latest recommended patches
node web31 192.168.2.31 Install the latest recommended patches
Node Web32 Windows Server Core 192.168.2.32 Install the latest recommended patches


First pit: Windows Server Core

1. Operating system partition pits

Because we use the Windows image is based on the Microsoft/windowsservercore size is around 10G, also need to install IIS, ASPNET and so on, in addition, if it involves a mirror export will also occupy C space, If you are doing Docker, it is recommended that the C disk space is not less than 60G, or simply divide the C drive.

Step on the Pit solution: in the case of a large amount of spare space on the hard disk, you can mount the C:\ProgramData\docker\windowsfilter folder in the form of a mounted folder

650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M01/9B/30/wKioL1lfLpmzYXVfAAIbUUyH2k8544.jpg "title=" 1.jpg "alt=" Wkiol1lflpmzyxvfaaibuuyh2k8544.jpg "/>


2. Command line how to set the machine IP and machine name and open Remote Desktop

To execute sconfig at the cmd command prompt, it is recommended to turn on Remote Desktop aspect command input

650) this.width=650; "src=" https://s4.51cto.com/wyfs02/M02/9B/30/wKiom1lfLqfAxUXTAACuVt1f56k440.jpg "title=" 2.jpg "alt=" Wkiom1lflqfaxuxtaacuvt1f56k440.jpg "/>

3. You must install the latest Windows patches before installing Docker

Method: Sconfig--->6) download and install the update--->r) only search for recommended updates---->a) Install all


4. How files are copied to Windows Server core under the command line

Turn on writable sharing

CD \

mkdir Share

NET share Share=c:\share/grant:everyone,full

Connection Sharing

NET use Z: \\192.168.2.30\share password/user:administrator

Then the map is shared to the Z-disk, the z-disk to operate the file

Delete Share

NET share c:\share/del/y


5. How to view files on the Windows command line

Type filename.txt

Append file

echo 127.0.0.1 Web30 >>\windows\system32\drivers\etc\hosts


6. View Windows processes

Tasklist


7. Kill the Process

Tskill


Second pit: Windows 2016 native Docker

1.Windows Installing Docker

Access PowerShell at the command prompt,

Install-module-name dockermsftprovider-repository Psgallery-forceinstall-package-name Docker-providername Dockermsftprovider

If the second prompt does not install the patch, you need to install the latest Windows patch, enter Sconfig 6th step

Restart the server after installation is complete


2. Configure firewall rules for all servers

TCP Port 2377 for cluster Management communication

TCP and UDP Port 7946 for inter-node communication

TCP and UDP Port 4789 for overwriting network traffic

netsh advfirewall firewall add rule name= "SWM 2377" dir=in action=allow protocol=tcp localport=2377 netsh advfirewall fire  Wall Add rule name= "SWM 7946" dir=in action=allow protocol=tcp localport=7946netsh advfirewall Firewall add rule name= "SWM 7946UDP "Dir=in action=allow protocol=udp localport=7946netsh advfirewall Firewall add rule name=" SWM 4789 "dir=in action  =allow protocol=tcp localport=4789netsh advfirewall Firewall add rule name= "SWM 4789udp" Dir=in action=allow protocol=udp localport=4789


3. Initializing cluster mode

Execute on Master

c:\> Docker swarm init--advertise-addr=192.168.2.30--listen-addr 192.168.2.30:2377

Pit: Perform Docker swarm init on Linux to initialize the cluster, but will not be stuck on windows, you need to specify IP and port on Windows


4. Join the cluster (performed in Web31 and WEB32)

Prompt for input above

Docker swarm join--token SWMTKN-1-1LBJX00S1QSJBJFUOQ92F6D95MF41ARBHWBKKIGMO1SMJQS38R-8I0BDAKWHC3LVBBOG8FNMVGMW 19 2.168.2.30:2377

To join the cluster, note that it needs to be modified to one line

Docker swarm join--token SWMTKN-1-1LBJX00S1QSJBJFUOQ92F6D95MF41ARBHWBKKIGMO1SMJQS38R-8I0BDAKWHC3LVBBOG8FNMVGMW 192.168.2.30:2377

Pit 1: Join the cluster command only one line can not use \ for line wrapping

Pit 2: Be sure to open the appropriate rules in the firewall, open 2377/tcp, 7946/tcp, 7946/UDP, 4789/tcp, 4789/UDP ports

Pit 3: Currently testing Linux can join a Windows Swarm cluster, Windows can also join a Linux swarm cluster, but currently unable to manage the cluster


5. Service Port Mapping issues

In the Linux environment we can

Docker service Create-name web-p 80:80 nginx

Each node can be serviced via port 80 after execution, but not in Windows

Docker service Create-name iis-p 80:80 Microsoft/iis after execution is not accessible via 80 port

is currently through

Docker service Create-name iis-p mode=host,target=80,publish=80 Microsoft/iis

Then through the Docker service PS IIS

C:\users\administrator>docker service PS iisid NAME IMAGE NODE desired state current ST ATE ERROR portse118tf9vu15l iis.2 microsoft/iis:latest Web32 Running Running 2 hours ago *:8090 ->80/tcp

Can see the container on the WEB32, this time access to the 192.168.2.32:8090 can be normal access, but access to the host port 8090 is not available


6.Docker Private Warehouse Configuration

Configure a private warehouse

Method 1: Change the registry [Hkey_local_machine\system\currentcontrolset\services\docker]

Modified to C:\Program files\docker\dockerd.exe--run-service --insecure-registry "192.168.2.234:5000"

Method 2: Modify the Docker configuration file and recommend that you modify the configuration file

C:\ProgramData\docker\config\daemon.json

{

"Insecure-registries": ["192.168.2.234:5000"]

}

If not, the file can be created in assic form





This article is from "Maple Night" blog, please be sure to keep this source http://fengwan.blog.51cto.com/508652/1945304

Windows leverages swarm native Docker cluster Pit summary

Related Article

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.