HUAWEI CLOUD Yunyaoyun Server L Instance Evaluation|Deploy Statping Server Monitoring Tool in Docker Environment

I. Introduction

1.1 Introduction to Yunyao Cloud Server L instance

Yunyao Cloud Server L instance is a new generation of lightweight application cloud server, specially designed for small and medium-sized enterprises and developers, providing a convenient out-of-box experience. This product provides rich and strictly screened application images and can deploy applications with one click, greatly simplifying the process of customers building e-commerce websites, web applications, applets, learning environments, and various development and testing tasks in the cloud.

Insert image description here

1.2 Introduction to Statping

Statping is an open source service detection and monitoring tool that can be used to detect the availability and response time of web applications, servers and other network services. Statping provides visualization and alerting capabilities to notify users about changes in service status via email, Slack, webhooks, etc. The tool also provides basic statistics and charts to help users better understand the performance and availability of their services. Statping is a lightweight tool that is easy to use and deploy.

1.3 Stating Features

Statping is a self-hosted service monitor with the following features:

  • Support multiple protocols and service monitoring, including HTTP, TCP, UDP, DNS, Ping, etc.

  • Provides real-time notifications and alerts that can be sent to your phone or computer via email, Slack, Microsoft Teams, Discord, and more.

  • Monitoring frequency and timeout can be customized to suit different application needs.

  • Provides a web interface for easy management and monitoring of multiple services and hosts.

  • Auto-deployment and update feature, quick deployment and update via Docker or binaries.

  • Supports plug-ins and APIs to extend functionality and integrate into other tools and systems.

2. Introduction to this practice

2.1 Introduction to this practice

1. This practice is a personal test learning environment, aiming to quickly deploy applications. Please be cautious in the production environment;
2. This practice environment is a Yunyao Cloud Server L instance, and the application image used is Portainer 2.18.4;
3. In Portainer Deploy the Statping server monitoring tool on the platform.

2.2 This environmental plan

Server category Application image Intranet IP address Docker version Portainer version Statping version
Yunyao cloud server L instance Docker visualization Portainer 192.168.0.168 24.0.4 2.18.4 v0.90.75

3. Purchase Yunyao Cloud Server L instance

3.1 Purchase Yunyao Cloud Server L instance

1. Official website link: https://www.huaweicloud.com/product/hecs-light.html
2. Purchase specifications:
Region: North China-Beijing IV;
Application image: Docker visualization-Portainer;
Instance specifications: 2 cores 2G/system Disk 40G/peak bandwidth 3Mbps/traffic package 400G;
instance name: Customize it, edit it here as HECS-L-Portainer;
purchase duration: 1 month.

Insert image description here

3.3 View Yunyao Cloud Server L instance status

Check the status of the purchased Yunyao Cloud Server L instance, which is in normal operation.

Insert image description here

3.4 Reset server password

Click to remotely log in to Yunyao Cloud Server L instance

Insert image description here

Insert image description here

To reset the password, click the reset password option on the right, and identity verification is required. After selecting mobile phone verification, the password can be reset successfully.

Insert image description here

Insert image description here

4. Check the Docker environment

4.1 Xshell remote connection server

  • Copy the elastic public IP address and use it when connecting to the server remotely.

Insert image description here

  • In the Xshell tool, fill in the server’s elastic public network IP address, account and password information, and connect to the remote server with ssh.

Insert image description here

Insert image description here

4.2 Check the operating system version

Check the operating system version of Yunyao Cloud Server L instance, the operating system version is Ubuntu 22.04.1 LTS.

root@hcss-ecs-f91c:~# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

4.3 Check system status

  • Check memory usage
root@hcss-ecs-f91c:~# free -m
               total        used        free      shared  buff/cache   available
Mem:            1783         488          91           3        1204        1100
Swap:              0           0           0
  • Check disk usage
root@hcss-ecs-f91c:~# df -hT
Filesystem     Type     Size  Used Avail Use% Mounted on
tmpfs          tmpfs    179M  1.5M  177M   1% /run
/dev/vda1      ext4      40G   14G   24G  37% /
tmpfs          tmpfs    892M     0  892M   0% /dev/shm
tmpfs          tmpfs    5.0M  4.0K  5.0M   1% /run/lock
tmpfs          tmpfs    179M  4.0K  179M   1% /run/user/0
overlay        overlay   40G   14G   24G  37% /var/lib/docker/overlay2/1221c1906020843135c17ce891d88968355c5f22167913181a2cdaea8ef09e7f/merged
overlay        overlay   40G   14G   24G  37% /var/lib/docker/overlay2/9bcf1304bca2d0899ff645ad0c0dc790c8bcdfb241016b37c517537cac44663a/merged
  • View the overall resource usage of the system
top

Insert image description here

4.4 Check Docker version

Check the current version of Docker. When the Yunyao Cloud Server L instance uses the Portainer application image, the Docker environment has been automatically installed, and there is no need to reinstall the Docker environment.

root@hcss-ecs-f91c:/data/leanote# docker -v
Docker version 24.0.4, build 3713ee1

4.5 Check docker compose version

Check the docker compose version. The new version of Docker automatically integrates and installs the docker compose tool.

root@hcss-ecs-f91c:~# docker compose version
Docker Compose version v2.19.1

4.6 Check the local current container

Check the current running container locally. When the Yunyao Cloud Server L instance uses the Portainer application image, a Docker environment will be deployed and a container for the Portainer service will be created.

root@hcss-ecs-f91c:~# docker ps
CONTAINER ID   IMAGE                           COMMAND        CREATED        STATUS        PORTS                                                           NAMES
866f19377f2d   portainer/portainer-ce:2.18.3   "/portainer"   44 hours ago   Up 43 hours   8000/tcp, 9443/tcp, 0.0.0.0:9091->9000/tcp, :::9091->9000/tcp   portainer

5. Download the Statping image

5.1 Configure Docker image acceleration

In the Docker application image scenario of Yunyao Cloud Server L instance, the speed of pulling the image from docker hub is relatively fast. When some images are pulled too slowly, you can try configuring image acceleration.

  • Edit or create a new /etc/docker/daemon.json file and add the registry-mirrors item to it.
 vim /etc/docker/daemon.json
{
    
    
  "registry-mirrors": ["https://docker.mirrors.sjtug.sjtu.edu.cn"]
}
  • Restart the Docker service
systemctl daemon-reload
systemctl restart docker

5.2 Download PrestaShop image

Download Statping image from docker hub

docker pull statping/statping:dev
docker pull statping/statping:latest

Insert image description here

6. Deploy Statping server monitoring tool

6.1 Use docker-cli to deploy Statping

Use docker-cli to quickly deploy Statping

docker run -it -p 9080:8080 statping/statping

6.2 Use Portainer to deploy Statping

When the HUAWEI CLOUD Cloud Yaoyun L instance uses the application image as Portainer, the Portainer tool has been automatically installed.

  • docker-compose.yaml file
version: '2.3'

services:
  statping:
    container_name: statping
    image: statping/statping:dev
    restart: always
    volumes:
      - statping_data:/app
    environment:
      DB_CONN: sqlite
    ports:
      - 8080:8080

volumes:
  statping_data:
  • Deploy using Portainer stack mode

Insert image description here

6.3 Use docker compose to deploy Statping

Use docker compose to deploy Statping. In this practice, we choose to use docker compose.

version: '2.3'

services:
  statping:
    container_name: statping
    image: statping/statping:dev
    restart: always
    volumes:
      - statping_data:/app
    environment:
      DB_CONN: sqlite
    ports:
      - 9080:8080

volumes:
  statping_data:
root@hcss-ecs-f91c:/data/statping# docker compose up -d
[+] Running 3/3
 ✔ Network statping_default         Created                                                                                                                               0.0s
 ✔ Volume "statping_statping_data"  Created                                                                                                                               0.0s
 ✔ Container statping               Started                                                                                                                               0.4s

6.4 Check the running status of Statping container

Check the running status of the Statping container to ensure that the container is running normally and started.

root@hcss-ecs-f91c:/data/statping# docker ps
CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS                             PORTS             NAMES
8f86b0e52f1b   statping/statping:dev           "/bin/sh -c 'statpin…"   48 seconds ago   Up 47 seconds (health: starting)   0.0.0.0:9080->8080/tcp, :::9080->8080/tcp             statping

6.5 Check container running logs

Check the container running log to ensure that the Statping service starts normally

Insert image description here

7. Access Statping service

7.1 Release security group ports

On the security group management page of Yunyao Cloud Server L instance, allow port 9080 in the inbound direction.

Insert image description here

Insert image description here

7.2 Visit Statping home page

Access address: http://Elastic public IP address: 9080, replace the IP address with the elastic public IP address of your own server.

Insert image description here

8. Basic use of Statping

8.1 Log in to the dashboard backend management

  • At the bottom of the home page, click Login Dashboard.

Insert image description here

  • The default login account password is admin/admin

Insert image description here
Insert image description here

8.2 Set system Chinese

At the top of the dashboard management page, click Settings - Language - Chinese - Save to set the system language to Chinese.

Insert image description here
Insert image description here

8.3 Service Management

  • Select the service management module and delete the services added by the system by default.

Insert image description here

  • Create new service

Insert image description here

Service name: leanote note web service;
Service type: http;
Permanent link: leannote note web service
Service terminal node: Fill in the personal web site that can be accessed;
the rest can be defaulted.

Insert image description here
Insert image description here

8.4 Check test website status

Return to the homepage and you can see that the tested website service is already online.

Insert image description here

Guess you like

Origin blog.csdn.net/jks212454/article/details/132768066