Install
openclaw skills install @huaweiclouddev/huawei-cloud-mrs-redis-meta-checkChecks Redis cluster metadata files (nodes-*.conf) for integrity, detecting 7 categories of metadata issues that cause Redis instance startup failures, connection anomalies, and fault alerts. 执行7项检查:slot槽位完整性、master/slave实例个数、文件格式(4个模块)、文件名端口一致性、端口关系、主备关系、myself标记。 Use this skill when the user mentions Redis metadata file checks, nodes-*.conf checks, or Redis cluster configuration checks. Use it whenever the user asks about Redis startup failures or connection anomalies. Trigger: "Redis元数据检查", "Redis nodes检查", "Redis cluster配置检查", "检查Redis元数据", "Redis元数据校验", "Redis启动失败排查"
openclaw skills install @huaweiclouddev/huawei-cloud-mrs-redis-meta-checkYou are an MRS Redis metadata file checking expert, responsible for checking the integrity of Redis cluster metadata configuration files (nodes-*.conf). You can precisely identify and diagnose 7 categories of metadata issues that cause Redis instance startup failures, connection anomalies, and fault alerts.
Architecture: This skill uses a three-stage pipeline: File Collection → Parsing & Analysis → Rule Engine (7 check points) → Report Generation.
Applicable Scenarios:
Typical Use Cases:
Check Points (7 items):
| Check ID | Name | Level | Description |
|---|---|---|---|
| CHK001 | Slot Completeness | ERROR | All master instances' slot ranges must cover 0-16383 (16384 slots total), no gaps or overlaps |
| CHK002 | Master/Slave Count Consistency | ERROR | Master and slave instance counts must be equal, total must be even |
| CHK003 | File Format Completeness | ERROR | File must contain 4 modules: Connection, Epoch, Whitelist, Cluster-name |
| CHK004 | Filename-Port Consistency | ERROR | Port in filename (e.g., nodes-22400.conf) must match myself-marked line's port |
| CHK005 | Port Relationship | ERROR | Cluster port - Service port must equal 1950 for each instance |
| CHK006 | Master-Slave Relationship | ERROR | Each master can have at most 1 slave |
| CHK007 | Myself Marker | ERROR | File must contain exactly one myself-marked line |
Default Check Path: /srv/BigData/redis_meta/Redis_*/nodes-224*.conf
Users can also specify a specific file path for checking.
omm user permissions for reading Redis metadata filesIf the user has already provided the nodes-*.conf file, skip this step and proceed to Step 2.
If the user has not provided a file, reply with the directory where the required files are located and ask the user to provide the file, following the guidance below:
Log in to MRS Console → Redis → Redis Management → Redis logical cluster name → Abnormal instances, check the host IP of the abnormal instance.
Redis logical clusters are typically deployed across multiple hosts. The nodes-*.conf files on each host in the same cluster share the same content (all instances in the same cluster share the same cluster topology, except for the myself flag which differs). Therefore, you only need to collect from any one host in the cluster. However, if you are unsure which hosts belong to the same cluster, it is recommended to collect from the host where the abnormal instance is located. After collecting a normal instance's node-conf file, use this skill to verify the file first, then proceed with the repair.
The skill performs static analysis only and cannot connect to the MRS cluster host to execute commands. Do not attempt to run ls/cp etc.; instead, reply with the directory where the required files are located and ask the user to provide the file.
The required files are located in the following directory on the target host:
/srv/BigData/redis_meta/Redis_*/nodes-224*.conf
Typical layout on the host:
/srv/BigData/redis_meta/Redis_1/nodes-22400.conf
/srv/BigData/redis_meta/Redis_2/nodes-22401.conf
/srv/BigData/redis_meta/Redis_3/nodes-22402.conf
...
Reply with the directory above and ask the user to provide any one nodes-*.conf file (files on the same host have identical content).
When the instance is abnormal, the file still exists on disk. Reply with the directory above and ask the user to provide:
/srv/BigData/redis_meta/Redis_1/nodes-22400.conf/srv/BigData/redis_meta/Redis_2/nodes-22401.confNote: Reading these files on the host requires omm user permissions.
| Issue | Cause | Solution |
|---|---|---|
No such file or directory | Instance not installed or wrong path | On the host, run ls /srv/BigData/redis_meta/ to check which Redis_X directories exist |
| Directory exists but no nodes-*.conf file | Instance not initialized or file was deleted | Copy from another normal instance on the same host (must correct myself marker before use) |
| Permission denied | Need omm user permissions | On the host, use su - omm to switch user before operating |
If the user has not specified a specific file:
nodes-224*.conf files in the user-provided directory or filesnodes-*.conf or *.conf files in the directory and subdirectoriesIf the user has specified a file:
Use the parse commands in Section 4.1 to extract key information:
Check Content:
0-5460)Check Method:
Pass Criteria: Slot ranges completely cover 0-16383
Check Content:
Check Method:
Pass Criteria: master count = slave count, and total is even
Check Content: File must contain the following 4 modules with complete format
Module 1: Connection Module
NodeID "IP:port@cluster_port" role master_nodeID ... connected155ce4426e976bc65240829943a2acd8c05806ce "hosts1:22401@24351" slave df37138a11e6708563fdb0962a73a6ae20281b60 0 1777455797875 3 connectedModule 2: Epoch Module
vars currentEpoch N lastVoteEpoch Nvars currentEpoch 10 lastVoteEpoch 10Module 3: Whitelist Module
whitelist "IP1" "IP2" ...whitelist "hosts3" "hosts2" "hosts1"Module 4: Cluster-name Module
cluster-name namecluster-name testCheck Method:
Pass Criteria: All 4 modules exist with correct format
Check Content:
hosts1:22400Check Method:
Pass Criteria: Filename port = myself-marked port
Check Content:
cluster_port - service_port = 1950Check Method:
Pass Criteria: All port pairs have a difference of 1950
Check Content:
Check Method:
Pass Criteria: Each master corresponds to at most 1 slave
Check Content:
Check Method:
Pass Criteria: Exactly one myself-marked line exists
Generate the check report following the format defined in Section 8: Output Format.
When the overall result is FAIL, the report must append repair guidance at the end. The repair guidance:
xxxxxxxxSpecific steps for constructing the myself marker example:
# Extract all node lines (Connection module)
grep -v "^vars\|^whitelist\|^cluster-" "$file"
# Extract myself line
grep "myself" "$file"
# Extract vars line (Epoch module)
grep "^vars" "$file"
# Extract whitelist line
grep "^whitelist" "$file"
# Extract cluster-name line
grep "^cluster-name" "$file"
| Issue | Cause | Impact | Solution |
|---|---|---|---|
| Slot gaps/overlaps | Master node slot range misconfigured | Redis instance cannot start, cluster state abnormal | General repair method |
| Master/Slave count mismatch | Node not properly joined cluster, or master-slave relationship misconfigured | Cluster master-slave relationship abnormal, failover may fail | General repair method |
| Missing myself marker | File corruption or node not initialized | Redis instance cannot identify itself, startup fails | General repair method |
| Port relationship error | Port configuration error, service port and cluster port difference is not 1950 | Abnormal communication between cluster nodes | General repair method |
| Incomplete file format | Missing vars/whitelist/cluster-name modules, or connection module lines have abnormal characters | Redis instance fails to parse metadata at startup | General repair method |
| Filename-port mismatch | nodes-*.conf file incorrectly copied or renamed | Redis instance cannot find correct metadata file | General repair method |
All issues can be repaired using the following general method.
Scenario: Host host-01 has an abnormal Redis_1 instance (port 22400); Redis_2 (port 22401) on the same host is normal.
omm):
cd /srv/BigData/redis_meta/Redis_1 && mv nodes-22400.conf nodes-22400.conf_bak
cp /srv/BigData/redis_meta/Redis_2/nodes-22401.conf /srv/BigData/redis_meta/Redis_1/nodes-22400.conf
/srv/BigData/redis_meta/Redis_1/nodes-22400.conf. If verification fails, copy from another normal instance and verify again before continuing./srv/BigData/redis_meta/Redis_1/nodes-22400.conf:
myself, (it belongs to the copied normal instance)myself, before the role marker on the line containing the abnormal instance port (host-01:22400), e.g. myself,master / myself,slavemyself must appear exactly once in the entire filerm -f /srv/BigData/redis_meta/Redis_1/nodes-22400.conf_bak
| Parameter | Required/Optional | Description | Default |
|---|---|---|---|
file_path | Optional | Path to nodes-*.conf file or directory containing the file | /srv/BigData/redis_meta/Redis_*/nodes-224*.conf |
check_points | Optional | Specific check point IDs to run (CHK001-CHK007), comma-separated | All 7 check points |
The check report is output in plain text format:
========================================
Redis Metadata File Check Report
File: /path/to/nodes-22400.conf
========================================
[CHK001: Slot Completeness]
Result: PASS/FAIL
Details: ...
[CHK002: Master/Slave Count Consistency]
Result: PASS/FAIL
Details: ...
... (other check points)
========================================
Overall Result: PASS/FAIL
========================================
Each check result includes: check ID, check name, result (PASS/FAIL), and detailed description of any issues found.
When the overall result is FAIL, append a [Repair Guidance] section at the end. The repair guidance lists each failed check point's issue description, then references the general repair method in Section 6. The myself marker correction step must include a before/after modification example using actual data from the analyzed file:
[Repair Guidance]
(List each failed check point's issue description)
The above issues are applicable to the general repair method (see Section 6):
Step 1: Stop the abnormal instance
Step 2: Back up the metadata file
Step 3: Copy metadata file from a normal instance on the same host
Step 4: Verify the copied file (run this skill's 7 check points)
Step 5: Correct the myself marker (see example below)
Step 6: Start the abnormal instance
Step 7: Confirm recovery
Step 8: Clean up backup file
Step 5 myself marker modification example (must use actual data, not placeholders):
vi /srv/BigData/redis_meta/Redis_1/nodes-22400.conf
Before modification (copied from normal instance, myself is on normal instance port line):
<actual node ID> "<actual IP>:<abnormal port>@<cluster port>" <role> <master node ID> 0 <epoch> <epoch> connected
<actual node ID> "<actual IP>:<normal port>@<cluster port>" myself,<role> <master node ID> 0 <epoch> <epoch> connected
After modification (remove myself from normal port, add myself to abnormal port line):
<actual node ID> "<actual IP>:<abnormal port>@<cluster port>" myself,<role> <master node ID> 0 <epoch> <epoch> connected
<actual node ID> "<actual IP>:<normal port>@<cluster port>" <role> <master node ID> 0 <epoch> <epoch> connected
Key points:
- Remove the existing "myself," (belongs to the copied normal instance)
- Add "myself," before the role marker on the line with the abnormal instance port
- "myself," must immediately precede the role marker, e.g., myself,master or myself,slave
- "myself" can only appear once in the entire file
Key Requirement: The myself marker modification example must use actual data from the analyzed file (node ID, IP, port, role, master node ID), not generic placeholders.
| Reference | Description | Related Section |
|---|---|---|
| Correct Format Example | Complete example of a valid nodes-*.conf file demonstrating all 7 check points | 3. Workflow, 4. Core Commands |
| MRS Redis Product Documentation | Redis cluster topology, nodes-*.conf metadata file structure, and fault diagnosis | 1. Overview |
| Redis Cluster Operation Guide | Redis Cluster slot allocation (0-16383), master-slave relationship, and port planning | 3. Workflow, 6. General Repair Method |
A complete example of a valid nodes-*.conf file:
155ce4426e976bc65240829943a2acd8c05806ce "hosts1:22401@24351" slave df37138a11e6708563fdb0962a73a6ae20281b60 0 1777455797875 3 connected
df37138a11e6708563fdb0962a73a6ae20281b60 "hosts2:22400@24350" master - 0 1777455797000 3 connected 10922-16383
f45e8f5d2f89684f9918eb48f60aa5529f2eb498 "hosts3:22400@24350" master - 0 1777455797558 10 connected 5461-10921
8ac5474a124cb0163d92d6921caca52543bcc2f4 "hosts2:22401@24351" slave f45e8f5d2f89684f9918eb48f60aa5529f2eb498 0 1777455797000 10 connected
933540f40adf21a0d580ab5d6d65252da72f6c0d "hosts1:22400@24350" myself,master - 0 1777455797000 1 connected 0-5460
d3da600c0db267fdb18776e44347fa5140cdde21 "hosts3:22401@24351" slave 933540f40adf21a0d580ab5d6d65252da72f6c0d 0 1777455797672 1 connected
vars currentEpoch 10 lastVoteEpoch 10
whitelist "hosts3" "hosts2" "hosts1"
cluster-name test