Procedure
To view information about all services running in the cluster, execute the following command on any cluster node. The output defaults to the text format:
zbs-tool service list
You can also specify the output format:
JSON format:
zbs-tool -f json service list
If you plan to write automation scripts or test programs to parse command output, using JSON is strongly recommended. JSON output maintains forward compatibility, ensuring scripts work properly after version upgrades.
Text format:
zbs-tool -f table service list
Text output may be adjusted or optimized in future versions, so forward compatibility is not guaranteed. Using this format in test scripts may cause failures after upgrades.
Output example
Text format:
Name Members Leader Specified members Priority Current priority
------ ------------------------------------------------------------ ---------------- ------------------------------------------------------------ ---------- ------------------
meta ['10.0.20.52:10100', '10.0.20.51:10100', '10.0.20.50:10100'] 10.0.20.50:10100 ['10.0.20.50:10100', '10.0.20.51:10100', '10.0.20.52:10100']
ntp ['10.0.20.52:0', '10.0.20.51:0', '10.0.20.50:0'] 10.0.20.50:0 ['']
taskd ['10.0.20.51:10601', '10.0.20.50:10601', '10.0.20.52:10601'] 10.0.20.50:10601 ['']JSON format:
[{"Name": "insight", "Members": "['10.234.1.2:10701', '10.234.1.3:10701', '10.234.1.1:10701']", "Leader": "10.234.1.3:10701", "Specified members": "['']", "Priority": "", "Current priority": ""}, {"Name": "meta", "Members": "['10.234.1.2:10100', '10.234.1.3:10100', '10.234.1.1:10100']", "Leader": "10.234.1.2:10100", "Specified members": "['10.234.1.2:10100', '10.234.1.1:10100', '10.234.1.3:10100']", "Priority": "10.234.1.2:10100:3,10.234.1.1:10100:2,10.234.1.3:10100:1", "Current priority": ""}]
Output note
| Parameter | Description |
|---|---|
Name | The name of the service running in the cluster. |
Members | The members included in the service, formatted as IP:Port. |
Leader | The current leader of the service. |
Specified members | The nodes running the meta service. |
Priority | The priority set for the members of a service is an integer between 0 and 255. The higher the value, the greater the priority. If a node is not displayed in Priority, its default priority is 1. |
Current priority | The priority of the members of the current service. Current priority can be automatically and dynamically adjusted based on the node's status, within a range not exceeding Priority. When a node detects an anomaly, it will actively lower its current priority. Once the service is restored, the current priority will be reset to the configured priority. When the node runs normally, Current priority is the same as Priority. If a node is not displayed in Current priority, its Current priority will default to Priority. |
Procedure
Run the following command on any node in the cluster:
zbs-tool service show <service_name>
<service_name> refers to the service name whose detailed information is to be queried.
Usage example
zbs-tool service show meta
Output example
----------------- -----------------------------------------------------------------------------------------
Name meta
Members ['10.10.25.47:10100', '10.10.29.172:10100', '10.10.29.232:10100', '10.10.31.176:10100']
Leader 10.10.25.47:10100
Specified members ['[10.10.25.47:10100', '10.10.31.176:10100', '10.10.29.172:10100', '10.10.29.232:10100]']
Priority 10.10.25.47:10100:2,10.10.31.176:10100:2,10.10.29.172:10100:1,10.10.29.232:10100:1
Current priority
----------------- -----------------------------------------------------------------------------------------Output note
| Parameter | Description |
|---|---|
Name | The name of the service running in the cluster. |
Members | The members included in the service, formatted as IP:Port. |
Leader | The current leader of the service. |
Specified members | The nodes running the meta service. |
Priority | The priority set for the members of a service is an integer between 0 and 255. The higher the value, the greater the priority. If a node is not displayed in Priority, its default priority is 1. |
Current priority | The priority of the members of the current service. Current priority can be automatically and dynamically adjusted based on the node's status, within a range not exceeding Priority. When a node detects an anomaly, it will actively lower its current priority. Once the service is restored, the current priority will be reset to the configured priority. When the node runs normally, Current priority is the same as Priority. If a node is not displayed in Current priority, its Current priority will default to Priority. |
Procedure
Execute the following command to list the VIPs of all services:
vipservice-tool show
Output example
+------------+--------------+---------------------------------------------+
| NAME | IP | VIP-LEADER |
+------------+--------------+---------------------------------------------+
| iscsi | 101.19.1.74 | f9c441ee-91b4-4b43-b13f-ff3136fd2bf8/node34 |
| management | 192.168.66.5 | 784a8264-948e-4742-93a0-8b50c9e0a81e/node31 |
+------------+--------------+---------------------------------------------+