Manually installing Docker on each machine is painful for clustered servers, but there’s the Docker Machine, one of the three Dockers.
Address: https://www.cnblogs.com/CKExp/p/9552272.html
1. Introduction of Docker Machine
The tool has been around for quite some time, Docker Machine official introduction: https://docs.docker.com/v1.13/machine/overview/ in my understanding is a control department master landing.The next batch of people is like this graph, facing different servers, cloud, virtual machine, local host and so on. Bulk installation is done through Docker Machine.
Two. Introduction to server environment
The current server version CentOS7.2 64bit, Docker version 1.13.1, Docker Machine version 0.10.0.
Server list:
Master:182.61.xxx.218 — A
Slave:106.12.xxx.4 –B
Slave:118.126.xxx.29 –C
Slave:123.207.xxx.233 –D
The installation of Docker environment on B, C and D will be completed through server A.
Three, complete Docker Machine building:
First, we install the Docker environment on the A server. The installation process is visible: https://www.cnblogs.com/CKExp/p/8159269.html, where we start the installation of the Docker Machine directly.
Start installing Docker Machine on Server A, type the following command to download it from the docker repository and configure the permissions. Note that the version I downloaded here is 0.10.0. If you need a higher version, you can download it from another version.
1 $ curl -L https://github.com/docker/machine/releases/download/v0.10.0/docker-machine-$(uname -s)-$(uname -m) >/tmp/docker-machine && 2 chmod +x /tmp/docker-machine && 3 sudo cp /tmp/docker-machine /usr/local/bin/docker-machine
Build successfully, view server version:
docker-machine -v
Four. Use docker Machine to configure child nodes to install Docker engine.
First of all, we have to ensure the normal communication between the two servers, so Mr. key pairs, to ensure that no interactive login.
Create a key pair (in the A host operation), enter the command and always return.
# ssh-keygen
Copy the public key to the B, C and D hosts, the process needs to confirm the connection, input the password (directly logged in to the target host password) and other operations, can proceed normally.
# ssh-copy-id root@106.12.xxx.4
Then whether the connection can logon to the target host through the command connection
# ssh root@106.12.xxx.4
Next, you can install the docker environment on each child node in turn, using the command create provided by the docker-machine and its various accompanying specifications, and the-d command specifies the drive type of the reference. I’m all a Linux server, directly using generIC can be, if it is other types, you can take a look at the type of driver provided by the official website.
# docker-machine create -d generic --generic-ip-address=106.12.xxx.4 --generic-ssh-user=root host3
Specifies that the target server is named host3, and when the server is logged in, the name changes to host3.
Join successfully to view current node information
# docker-machine ls
At this point, the Docker of the three sub node server is installed.
Next, we start building swarm clusters to complete the distribution of services.
Address: https://www.cnblogs.com/CKExp/p/9552272.html
2018-09-01,Hope that you can come back and see your footsteps after success.