SpringCloud combat (13) - Lightweight cluster management tools (Portainer)

This article is SpringCloud combat (13) - Lightweight cluster management tools (Portainer), to focus on the first article, please click the portal:

SpringCloud combat (XII) - automated quality inspection tool (SonarQube)

We introduced earlier Sonar Jenkins integrated automated quality inspection. With our growing number of containers, and the management is also slowly powerless, this time we may need a tool to help us achieve container management, if you are using kubernetes, then congratulations, kubernetes own container management system, which articles you can skip the article talking about the realization docker container cluster management by Portainer, then what is Portainer?

A, Portainer Profile

Portainer is an open source, lightweight Docker management user interface, based on Docker API, provides a status display panel, application templates for rapid deployment, container mirrored the basic operation of the network data volumes (including uploading and downloading images, create operational containers, etc.), event log shows The container console operator, Swarm clustering and centralized management and operation services, user login management and control functions. Function is very comprehensive, can basically meet all the needs of small and medium units for container management.

Portainer official figure:

Second, prepare for work

Need docker 1.12 or later Centos7 environment.

Three, Portainer deployment

1, stand-alone deployment

portainer deployment is relatively simple, according to the official tutorial knock it on the line.

Portainer official deployment Tutorial

Portainer Server deployed on a separate LINUX Docker host / single-node cluster

$ docker volume create portainer_data
$ docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer

2, cluster deployment

Use Portainer Server and LINUX Swarm cluster management Portainer Agent

Deployment Portainer and Portainer Agent to manage Swarm cluster is very simple! You can directly Portainer Docker deployed as a cluster service. Note that this method will automatically deploy a single instance of Portainer Server, and Portainer agents deployed as a cluster on each node in the global service

$ curl -L https://downloads.portainer.io/portainer-agent-stack.yml -o portainer-agent-stack.yml
$ docker stack deploy --compose-file=portainer-agent-stack.yml portainer

In LINUX Swarm cluster on a remote Portainer Agent deployed as Swarm service, run this command on a remote cluster node manger.

$ docker service create --name portainer_agent --network portainer_agent_network --publish mode=host,target=9001,published=9001 -e AGENT_CLUSTER_ADDR=tasks.portainer_agent --mode global --mount type=bind,src=//var/run/docker.sock,dst=/var/run/docker.sock --mount type=bind,src=//var/lib/docker/volumes,dst=/var/lib/docker/volumes –-mount type=bind,src=/,dst=/host portainer/agent

3. Verify

Portainer stand-alone, cluster deployments official account are very clear, accessible after deployment  http://192.168.3.206:9000 , users need to register debut, set a password for the admin user, as shown:

Then Portainer can be logged into the system, as shown:

We first added to Endpoints terminal equipment, as shown:

The machine needs to be installed docker and open port 2375, then we can manage the container on the machine, mirror, swarm and so on.

This Portainer deployed.

Published 352 original articles · won praise 390 · views 370 000 +

Guess you like

Origin blog.csdn.net/qq_19734597/article/details/90511284