In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Monitor sharp weapon sysdig (real-time view)
Sysdig is a lightweight system monitoring tool, and it also natively supports containers. Sysdig allows us to take a closer look at the behavior of linux operating systems and containers. There are many common monitoring tools on Linux, such as strace,tcpdump,htop, iftop,lsof. Sysdig integrates the functions of these tools into one tool and provides a friendly and unified operation interface.
/ / the easiest way to install and run sysdig is to run the docker container. The command is: [root@sqm-docker01 ~] # docker run-it-- rm-- name=sysdig-- privileged=true-v / var/run/docker.sock:/host/var/run/docker.sock-v / dev:/host/dev-v / proc:/host/proc:ro-v / boot:/host/boot:ro-v / lib/modules:/host/lib/module:ro-v / usr:/host/usr:ro sysdig/sysdig
/ / if prompted to download failed, run the following command: sysdig-probe-loader
As you can see, the sysdig container runs in privileged mode and reads data such as operating system / dev,/proc in order to get enough system information. After startup, enter the container via docker container exec-it sysdig bash.
/ / execute the csysdig command after success, and sysdig:root@971f955c2f7b:/# csysdig will be started interactively
Click "F2 (Views)" after entering the interface, and then double-click "Containers".
This interface can monitor all kinds of information of the container in real time:
If you want to see a process running in a container, such as nginx, move the cursor to the target container, then enter or double-click.
You can also continue to double-click to view threads in the process.
Go back to the previous level and press the backspace key. Sysdig is very interactive, if the interface shows a lot of items, you can click on the bottom Search menu, and then enter keywords to find. As shown in the following figure, the keyword is service.
If you feel that the interface refreshes too fast to see the information you follow clearly, you can click on the Pause menu at the bottom. The characteristics of sysdig are as follows: complete monitoring information, including Linux operating system and container. The interface is highly interactive.
However, sysdig shows real-time data and does not see changes or trends. And it is the command line operation mode, which needs to be executed on the Host by ssh, which will bring some inconvenience.
2. Monitoring sharp weapon Weave Scope:
The most important feature of Weave Scope is that it automatically generates a map of the Docker container, allowing us to understand, monitor and control the container intuitively.
1. Install scope:
Download the source code on github: [root@sqm-docker01 ~] # wget https://github.com/weaveworks/scope/archive/v1.11.0.tar.gz
[root@sqm-docker01 ~] # cd / usr/local/bin/scope-1.11.0/ [root@sqm-docker01 ~] # cd / usr/local/bin/scope-1.11.0/ [root@sqm-docker01 scope-1.11.0] # mv scope / usr/local/bin/ [root@sqm-docker01 scope-1.11.0] # chmod + x / usr/local/bin/scope
[root@sqm-docker01 scope-1.11.0] # scope launch
How to deploy if there are more than one dockerhost now.
(1) download weave/scope image [root@sqm-docker02 ~] # docker pull weaveworks/scope
(2) download the v1.11.0 source code package and decompress it (the package supports the following execution command)
[root@sqm-docker02 ~] # tar zxf v1.11.0.tar.gz [root@sqm-docker02 ~] # cd scope-1.11.0/ [root@sqm-docker02 scope-1.11.0] # cp scope / usr/local/bin/ [root@sqm-docker02 scope-1.11.0] # chmod + x / usr/local/bin/scope
(3) next, add a monitoring host to the docker01:
[root@sqm-docker01 scope-1.11.0] # scope launch 172.16.1.30 172.16.1.31 # Note that the local ip is in front and other hosts are behind
Same operation on docker02: [root@sqm-docker02 scope-1.11.0] # scope launch 172.16.1.31 172.16.1.30
Visit the web page: (the address of any of the hosts is OK)
It is found that the containers running on the two docker hosts can be monitored respectively.
Scope monitoring is aimed at the information of the container, it depends on the firewall, so it can not achieve remote control, and there are no restrictions on users, and the security factor is low.
-this is the end of this article. Thank you for reading-
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.