In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to monitor and manage Docker containers with Portainer.io. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
As Docker usage increases, monitoring Docker containers is becoming more challenging. A large number of Docker containers are created every day, so how to monitor them becomes very important. There are already some built-in tools and techniques, but configuring them is a bit complicated. As microservices-based architecture becomes the next de facto standard, learning this technology will add another skill to your knowledge base.
Based on these scenarios, there is an increasing need for a lightweight, robust mirror management tool. Portainer.io solves this problem. Portainer.io (latest version 1.20.2) is lightweight and can be configured in 2-3 commands, and has become popular among Docker users.
This tool has many advantages over other tools, some of which are as follows:
Lightweight (only 2 to 3 commands are required to install this tool, and the size of the installed image is between 26 M and 30 M)
Robust and easy to use
Available for Docker monitoring and building
Provides a detailed overview of Docker environments
Can manage containers, mirrors, networks, and volumes
Portainer is easy to deploy with just one Docker command (can run anywhere)
Full Docker container environment can be monitored
Portainer also has the following services:
community support
enterprise support
Professional services in conjunction with partner OEM services
Portainer functions and features are as follows:
1. Equipped with a beautiful dashboard, easy to use and monitor 2. Comes with a large number of built-in templates, easy to operate and create 3. Service Support (OEM and Enterprise Users Only) 4. Almost real-time monitoring of containers, mirrors, networks, volumes, and configurations 5. Docker cluster monitoring included 6. Versatile user management
How to install Docker CE in Ubuntu 16.04 / 18.04 LTS
How to install and configure Portainer.io on Ubuntu Linux / RHEL / CentOS
Note: The installation procedure below is done on Ubuntu 18.04, but it works equally well for RHEL and CentOS, assuming you have Docker CE installed on your system.
root@linuxtechi:~$ lsb_release -aNo LSB modules are available.Distributor ID: UbuntuDescription: Ubuntu 18.04 LTSRelease: 18.04Codename: bionicroot@linuxtechi:~$
Create a volume for Portainer:
root@linuxtechi:~$ sudo docker volume create portainer_dataportainer_dataroot@linuxtechi:~$
Use the Docker command below to run the Portainer container:
root@linuxtechi:~$ sudo docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainerUnable to find image 'portainer/portainer:latest' locallylatest: Pulling from portainer/portainerd1e017099d17: Pull complete0b1e707a06d2: Pull completeDigest: sha256:d6cc2c20c0af38d8d557ab994c419c799a10fe825e4aa57fea2e2e507a13747dStatus: Downloaded newer image for portainer/portainer:latest35286de9f2e21d197309575bb52b5599fec24d4f373cc27210d98abc60244107root@linuxtechi:~$
After installation, open Portainer in browser via host or Docker IP plus port 9000 used by Docker engine.
Note: If the system firewall of Docker host is open, you need to ensure that port 9000 is released, otherwise the browser page will not be opened.
On my side, my Docker host/engine IP is 192.168.1.16, so the URL is http://192.168.1.16:9000
Portainer-Login-User-Name-Password
When creating an admin user, make sure the password is 8 characters and the username is admin, then click "Create User."
Next go to the page shown below and check the "Local" box.
Connect-Portainer-Local-Docker
Click Connect to
You can see admin user's beautiful home page as shown below,
Portainer-io-Docker-Monitor-Dashboard
Portainer is now ready to run and manage your Docker container, as well as container monitoring.
Managing container images in Portainer
Portainer-Endpoints
Checking the current status, you can see that there are two containers already running, and if you create another one, it will be displayed immediately.
Start one or two containers on the command line like this,
root@linuxtechi:~$ sudo docker run --name test -it debianUnable to find image 'debian:latest' locallylatest: Pulling from library/debiane79bb959ec00: Pull completeDigest: sha256:724b0fbbda7fda6372ffed586670573c59e07a48c86d606bab05db118abe0ef5Status: Downloaded newer image for debian:latestroot@linuxtechi:/#
Then click the refresh button on the Portainer page (a confirmation message will appear, click "Continue" above) and you will see 3 containers as highlighted below.
Portainer-io-new-container-image
Click on "containers" circled in red in the image above, and the next page will display "Dashboard Endpoint summary."
Portainer-io-Docker-Container-Dash
On this page, click on "Containers" highlighted and circled in red above to monitor containers.
Simple way to monitor containers
Continue with the above steps and you will see a nice, elegant "Container list" page as shown below.
Portainer-Container-List
All containers can be controlled here (stopped, started, etc.).
On this page, stop the "test" container we started earlier (this is a debian container we started earlier).
Check the checkbox in front of this container and click the Stop button above to stop.
Stop-Container-Portainer-io-dashboard
On the command line, you will also see that the container has now stopped or exited:
root@linuxtechi:~$ sudo docker container ls -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESd45902e717c0 debian "bash" 21 minutes ago Exited (0) 49 seconds ago test08b96eddbae9 centos:7 "/bin/bash" About an hour ago Exited (137) 9 minutes ago mycontainer235286de9f2e2 portainer/portainer "/portainer" 2 hours ago Up About an hour 0.0.0.0:9000->9000/tcp compassionate_benzroot@linuxtechi:~$
Now, start the two containers that have been stopped (test and mycontainer2) in the Portainer page.
Select the check boxes in front of the stopped containers and click Start.
Start-Containers-Portainer-GUI
You will immediately see two window alerts saying "Container started successfully" and the status of both containers will change to running.
Conatiner-Started-successfully-Portainer-GUI
Step by step to explore a variety of other options and features
1. Click on the highlighted "Images" and you will see the following page:
Docker-Container-Images-Portainer-GUI
This is a list of available containers, some of which may not be running. These containers can be imported, exported or uploaded to different locations, as shown in the screenshot below.
Upload-Docker-Container-Image-Portainer-GUI
2. Click the highlighted "Volumes" to display the following page:
Volume-list-Portainer-io-gui
3, through the following operations, you can easily add volumes. Click the Add Volume button to display the following page. Enter the volume name in the name input box, such as "myvol", and click the "Create the volume" button:
Volume-Creation-Portainer-io-gui
The newly created volume looks like this (status unused):
Thank you for reading! About "how to use Portainer.io to monitor and manage Docker containers" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.