showdistribution 命令
语法:
gcadmin showdistribution [node]
node:显示 distribution 中每个 node 所包含的主备分片,可选参数。
功能:
显示 distribution 信息。
示例:
使用 gcadmin distribution gcChangeInfo.xml p 2 d 2 pattern 1 命令生成 distribution, gcChangeInfo.xml 如下所示:
<?xml version="1.0" encoding="utf-8"?>
<servers>
<rack>
<node ip="192.168.153.128"/>
<node ip="192.168.153.129"/>
<node ip="192.168.153.133"/>
</rack>
<rack>
<node ip="192.168.153.134"/>
<node ip="192.168.153.130"/>
<node ip="192.168.88.137"/>
</rack>
</servers>
gcChangeInfo.xml
生成 distribution 后, 使用 gcadmin showdistribution 命令, 不输入参数 node, 则按照分片顺序显示 distribution 信息, 如下所示:
$ gcadmin showdistribution
Distribution ID: 24 | State: new | Total segment num: 12 Primary Segment Node IP Segment ID Duplicate Segment node IP =============================================================================== | 192.168.153.128 | 1 | 192.168.153.129 | 192.168.88.137 ------------------------------------------------------------------------------- | 192.168.153.129 | 2 | 192.168.153.133 | 192.168.153.128 ------------------------------------------------------------------------------- | 192.168.153.133 | 3 | 192.168.153.134 | 192.168.153.129 ------------------------------------------------------------------------------- | 192.168.153.134 | 4 | 192.168.153.130 | 192.168.153.133 ------------------------------------------------------------------------------- | 192.168.153.130 | 5 | 192.168.88.137 | 192.168.153.134 ------------------------------------------------------------------------------- | 192.168.188.137 | 6 | 192.168.153.128 | 192.168.153.130 ------------------------------------------------------------------------------- | 192.168.153.128 | 7 | 192.168.153.129 | 192.168.88.137 ------------------------------------------------------------------------------- | 192.168.153.129 | 8 | 192.168.153.133 | 192.168.153.128 ------------------------------------------------------------------------------- | 192.168.153.133 | 9 | 192.168.153.134 | 192.168.153.129 ------------------------------------------------------------------------------- | 192.168.153.134 | 10 | 192.168.153.130| 192.168.153.133 ------------------------------------------------------------------------------- | 192.168.153.130 | 11 | 192.168.88.137 | 192.168.153.134 ------------------------------------------------------------------------------- | 192.168.188.137 | 12 | 192.168.153.128 | 192.168.153.130
显示 distribution 信息
使用 gcadmin showdistribution node 命令,按照节点显示 distribution分片信息,如下所示:
$ gcadmin showdistribution node Distribution ID: 24 | State: new | Total segment num: 12
=============================================================================== |nodes| 192.168.153.128 | 192.168.153.129 | 192.168.153.133 | 192.168.153.134 | 192.168.153.130 | 192.168.88.137 | ------------------------------------------------------------------------------- |primary| 1 | 2 | 3 | 4 | 5 | 6 | |segments| 7 | 8 | 9 | 10 | 11 | 12 | ------------------------------------------------------------------------------- |duplicate| 6 | 4 | 5 | 3 | 1 | 2 | |segments 1| 11 | 12 | 10 | 8 | 9 | 7 | ------------------------------------------------------------------------------- |duplicate| 2 | 3 | 1 | 5 | 6 | 4 | |segments 2| 9 | 7 | 8 | 12 | 10 | 11 |
显示 distribution 分片信息