Teach you how to use Portainer to manage multiple Docker container environments

Teach you how to use Portainer to manage multiple Docker container environments

Portainer manages multiple Docker container environments

1. Environmental Preparation

image-20211106112952384

# aliyun 2 cores 8G
139.196.95.123 Install docker and Portainer
# aliyun 1 core 2G 
47.100.34.199 install docker
# qingcloud 1 core 2G
139.198.167.214 Install Docker

2. Manage Docker

2.1 Install and run portaner

Install portaner on aliyun 2 core 8G server

# Install portainer
docker pull portainer/portainer
# Start portainer
docker run -d -p 8080:9000 --restart=always -v /var/run/docker.sock:/var/run/docker.sock --name prtainer portainer/portainer

systemctl daemon-reload
139.198.167.214:2375

2.2 Modify the configuration file

Modify /usr/lib/systemd/system/docker.service on all three machines

# Modify the configuration file vim /usr/lib/systemd/system/docker.service
# Add configuration file content ExecStart= xxxx -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock
xxx represents the original parameters, append -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock content # Save the startup file and restart the service systemctl daemon-reload
systemctl restart docker
# Check whether it is effective ss -unlpt | grep 2375 

image-20211106115620600

image-20211106115506509

2.3 Add Node

image-20211106121422712

# Name docker-prod01
docker-prod02
# IP address 47.100.34.199:2375
139.198.167.214:2375

2.4 Effect diagram

The effect diagram of the added docker node is as follows.

image-20211106122151375

3. Pitfall Records

3.1connection refused

FailureGet http://47.100.34.199:2375/_ping: dial tcp 47.100.34.199:2375: connect: connection refused

You need to modify the configuration file information and add -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock content

image-20211106113958518

This is the end of this article about managing multiple Docker containers with Portainer. For more information about Portainer Docker containers, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Project practice of deploying Docker containers using Portainer
  • Deployment and Chinese translation of the docker visualization tool Portainer
  • Installation and usage analysis of Portainer, a visual UI management tool for Docker
  • Tutorial on using portainer to connect to remote docker
  • Detailed steps for building Portainer visual interface with Docker

<<:  About IE8 compatibility: Explanation of the X-UA-Compatible attribute

>>:  Semanticization of HTML tags (including H5)

Recommend

Steps to deploy ingress-nginx on k8s

Table of contents Preface 1. Deployment and Confi...

Summary of the differences between global objects in nodejs and browsers

In Node.js, a .js file is a complete scope (modul...

How to embed other web pages in a web page using iframe

How to use iframe: Copy code The code is as follo...

How to use firewall iptables strategy to forward ports on Linux servers

Forwarding between two different servers Enable p...

How to modify the length limit of group_concat in Mysql

In MySQL, there is a function called "group_...

CSS3 uses var() and calc() functions to achieve animation effects

Preview knowledge points. Animation Frames Backgr...

mysql5.5 installation graphic tutorial under win7

MySQL installation is relatively simple, usually ...

Introduction to the use of select optgroup tag in html

Occasionally, I need to group select contents. In ...

Teach you how to get the pointer position in javascript

The method of obtaining the position of the point...

Three ways to delete a table in MySQL (summary)

drop table Drop directly deletes table informatio...

Where is the project location deployed by IntelliJ IDEA using Tomcat?

After IntelliJ IDEA deploys a Javaweb project usi...

Summary of HTML knowledge points for the front end (recommended)

1. HTML Overview htyper text markup language Hype...

HTML CSS3 does not stretch the image display effect

1. Use the transform attribute to display the ima...

Three ways to configure JNDI data source in Tomcat

In my past work, the development server was gener...