Ubuntu deployment Portainer under management docker

In the previous article, we deployed Shipyard to manage the cluster docker, overall is relatively simple, and Shipyard style interface is very simple, it is quite like, but can not be raised as node node display bug, and maintenance of the project had stopped, so I had to find another reliable tool. Search found, Portainer is a lightweight management tool, it is consistent with the requirements.

First of all, we still have to install docker, this step will not repeat them. Then follow the steps below to install Portainer, very simple.

The master node

Installation swarm

docker pull swarm

# 创建集群
docker swarm init --advertise-addr <MANAGER-IP>

When this is done is shown below:

It shows the way to join the working node. Here, the master node on the configuration is complete, it will default to join the local node.

Deployment Portainer

sudo docker service create \
         --name portainer \
         --publish 9000:9000 \
         --constraint 'node.role == manager' \
         --mount type=bind,src=/var/run/docker.sock,dst=/var/run/docker.sock \
         portainer/portainer \
         -H unix:///var/run/docker.sock

Work node

Work on the node according to the measures given in the previous step, adding a new node:

sudo docker swarm join --token SWMTKN-1-4zzd3zwswlix4hmxf68byzf3bds5sed2qtqgm1uao9g48tge61-9hu7w2cle8ic55ntnmqlzwuoi 192.168.56.103:2377


PS: Note that adding new manager node and worker nodes are the same commands, but not the same token. You can query token command:

docker swarm join-token worker/manager

If you want the old token is invalid and generate a new token:

docker swarm join-token --rotate

Then you can see the information of each node in the master node:

WEB access

External exposure to default port 9000, so you just visit http://<MANAGER-IP>:9000will be able to access the web-side pages. First visit you need to create a user and password.

Overall, the configuration is very simple and takes very little resources.

Guess you like

Origin www.cnblogs.com/xl2432/p/10941940.html