Cloud native use Docker to deploy ServerBee server monitoring tool
1. Introduction to ServerBee
1.1 Introduction to ServerBee
ServerBee is a web-based server monitoring and management tool that can be used to monitor server performance indicators, system status, network traffic and other information in real time, helping administrators better manage servers.
1.2 ServerBee features
- CPU load
- load average
- Memory usage
- Uptime/startup time
- File system mount (and disk usage)
- Disk I/O statistics
- Network Interface
- Network traffic statistics
- process list
- Detailed process
- kill process
- subprocess
2. Introduction to local environment
2.1 Local environment planning
This practice is a personal test environment, and the operating system version is centos7.6.
hostname | IP address | Operating system version | Docker version |
---|---|---|---|
server001 | 192.168.3.157 | centos 7.6 | 20.10.22 |
2.2 Introduction to this practice
1. The deployment environment for this practice is a personal test environment, please be cautious about the production environment;
2. Deploy the ServerBee server monitoring tool in the Docker environment.
3. Local environment inspection
3.1 Check Docker service status
Check whether the Docker service is running normally and ensure that Docker is running normally.
[root@server001 ~]# systemctl status docker
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2023-10-09 14:59:31 CST; 4 days ago
Docs: https://docs.docker.com
Main PID: 2562 (dockerd)
Tasks: 20
Memory: 1.7G
CGroup: /system.slice/docker.service
3.2 Check Docker version
Check Docker version
[root@server001 ~]# docker -v
Docker version 20.10.22, build 3a2c30b
3.3 Check docker compose version
Check the Docker compose version to make sure it is above 2.0.
[root@server001 ~]# docker compose version
Docker Compose version v2.14.1
4. Download the serverbee image
Pull the serverbee image from docker hub
[root@server001 ~]# docker pull zingerbee/serverbee-web
Using default tag: latest
latest: Pulling from zingerbee/serverbee-web
Digest: sha256:08ac0d31aabc476ab2c812c230bcfa4a3204f364703e986469903f1bdbc57f1a
Status: Image is up to date for zingerbee/serverbee-web:latest
docker.io/zingerbee/serverbee-web:latest
5. Deploy ServerBee
5.1 Create ServerBee container
Use docker-cli to quickly deploy serverbee containers
docker run -d \
-v /proc:/proc \
-v /dev:/dev \
-v /sys:/sys \
-v /etc:/etc \
-v /data/serverbee-web/media:/run/media \
-v /sys/class/net:/sys/class/net \
--privileged=true \
--restart unless-stopped \
--network=host \
--name=serverbee-web \
zingerbee/serverbee-web -p 9527
Deploy ServerBee using docker compose
version: "3.8"
services:
serverbee-web:
container_name: serverbee-web
image: zingerbee/serverbee-web
volumes:
- /proc:/proc
- /dev:/dev
- /sys:/sys
- /etc:/etc
- /data/serverbee-web/media:/run/media
- /sys/class/net:/sys/class/net
privileged: true
restart: unless-stopped
network_mode: host
expose:
- 9527
- Create ServerBee container using docker-compose.yaml file
docker compose up -d
5.2 Check ServerBee container status
Check the ServerBee container status to ensure that the container starts normally.
[root@server001 serverbee]# docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
serverbee-web zingerbee/serverbee-web "serverbee-web" serverbee-web About a minute ago Up About a minute
5.3 Check ServerBee container logs
Check the ServerBee container running log to ensure that the ServerBee service is running normally.
[root@server001 serverbee]# docker compose logs
serverbee-web | [2023-10-13 14:20:57 main INFO] starting HTTP server at http://localhost:9527
serverbee-web | [2023-10-13 14:20:57 main INFO] starting 2 workers
serverbee-web | [2023-10-13 14:20:57 main INFO] Actix runtime found; starting in Actix runtime
serverbee-web | [2023-10-13 14:20:57 main WARN] Token or server host is empty, will not start report thread!
6. Access ServerBee service
6.1 Set ToKen
Access address: http://192.168.3.157:9527/login, set the IP to your own server IP address, and set the access password.
6.2 Visit ServerBee homepage
After setting the login password, enter the ServerBee homepage.
7. Basic use of ServerBee
7.1 Check the overall monitoring status of the system
On the homepage, you can see various monitoring information of the system.
7.2 Check the process status
You can view the system process list individually
7.3 View disk/network details
Can view current disk/network details
7.4 System settings
In the setting management module, you can set the system service port, access password, etc.
7.5 Command line terminal
You can enter the command line terminal of the ServerBee container and use the command line to view the related status of the host.