RCMS Stack On Prem Admin Quick Start

1. Daily Health Check

The daily inspection should focus on host resources, Docker container status, and key service logs. Please refer to the tables below for verification.

1.1 Host Resource Check

Check Item Command Expected Result
CPU/Memory
top or htop
CPU usage rate is below 80%; Memory utilization rate is below 90%.
Disk Space
df -h
The / and /opt/rcms partition space is sufficient (Available space is higher than 20%).
Network Connectivity
ping [Gateway IP] or ping [External IP]
Network connection is normal, with no large number of dropped packets.

1.2 Docker Container Status Check

Check Item Command Expected Result
All Container Status
docker ps -a
The STATUS of all key containers (e.g., MySQL, MongoDB, Nacos, Web, Logstash) is Up.
Container Health Status
docker ps
The Health status of key containers is displayed as healthy. If it displays unknown, Up status generally indicates normal operation.
Specific Container Logs
docker logs --tail 50 [Container ID or Name]
Check whether the service is continuously outputting ERROR or Exception messages.
Tip: If the STATUS of any container displays Restarting or Exited, immediately check its logs for troubleshooting.

1.3 Critical Port Check

Port/ Service Command
Nginx Web (443)
netstat -tulnp | grep 443
Syslog (514)
netstat -tulnp | grep 514
RVPN Agent
ps aux | grep rvpn-server-agent
MQTT Server (1884)
netstat -tulnp | grep 1884
Mysql (3306)
netstat -tulnp | grep 3306
MongoDB (27017)
netstat -tulnp | grep 27017
Redis (6379)
netstat -tulnp | grep 6379
Nacos (1884)
netstat -tulnp | grep 1884
Logstash (5000)
netstat -tulnp | grep 5000

2. System Start/Stop Script

IMPORTANT Note:

To ensure service dependency relationships and data consistency, please always use the provided script to perform service start/stop operations. All operations must be executed with Root privileges in the root directory of the RCMS deployment.

2.1 Stop All Services (In safe order)

bash stop.sh all

Note: To stop specific services, execute bash stop.sh [serviceName]

2.2 Start/Restart All Services (In safe order)

bash restart.sh all

Note: To start or restart specific services, execute bash restart.sh [serviceName]

Service Name List:

logstash (docker-logstash.yaml)
mongo (docker-mongodb.yaml)
mq (docker-mq.yaml)
mysql (docker-mysql.yaml)
nacos (docker-nacos.yaml)
redis (docker-redis.yaml)
rvpn (Non-Compose Service)
syslog (Non-Compose Service)
web (docker-web.yaml)
xxl-job (docker-xxl-job-admin.yaml)
all (Stop/Start all services)

3. Maintenance Scripts

3.1 Clean Logs

sh cleanlog.sh

3.2 Compress Logs

sh compress_log_day.sh

3.3 Database Backup

Incremental backup of device telemetry data (MongoDB - one month):

nohup sh exportIncrementalData_with_all_company_mongodb.sh "[year-month]" > /data/script/export.log 2>&1 &

Example: Assuming the backup is for device telemetry data in September 2025:

nohup sh exportIncrementalData_with_all_company_mongodb.sh "202509"> /data/script/export.log 2>&1 &

3.4 Clean Up Database

nohup bash clean_data_mongodb.sh [Number of months to keep] > /data/script/clean.log &

Example 1: Keep the latest 3 months (Deletes all data earlier than 2025-08-01):

./clean_data_mongodb.sh 3

Example 2: Keep the latest 6 months:

./clean_data_mongodb.sh 6
Note: You need to install the Mongo command in advance: apt install mongodb-clients

3.5 Monitoring Script

sh rcms-monitor.sh

4. Common Issue Handling

4.1 Reset User Password

To reset the user password to Aa123456!, execute the following command via the backend database. Please replace [your account] with the actual username.

docker exec -i mysql5.7 mysql -h127.0.0.1 -P3306 -uroot -p4F53835FCB15BF84 -e "UPDATE rcms_pl.tbs_pl_user_new SET login_password='3211810614F5BEFD36060D0686693F7A9774F7B0CBBBDA84DD7E9CE5C93E70CF' WHERE login_account='[your account]'"

Note: 3211810614F5BEFD36060D0686693F7A9774F7B0CBBBDA84DD7E9CE5C93E70CF is the encrypted value for the password Aa123456!.