How to use gstatus utility in RHS 3.0.3 ?

As I have recently upgraded from 3.0.2 to 3.0.3 I have searching for some new featured in newer version of RHS. I came across wonderful utility gstatus which is used to check the health of cluster and volume.

I installed this utility on one node of gluster.

Step 1 : As my system is registered to redhat channels. I issued yum command to install gstatus.

[root@Node1 ~]# rhn-channel -l
rhel-x86_64-server-6
rhel-x86_64-server-6-rhs-3
rhel-x86_64-server-sfs-6

[root@Node1 ~]# yum install gstatus

Step 2 : Lets see the various usages of this utility.

a) I have installed below version of gstatus.

[root@Node1 ~]# gstatus –version
gstatus 0.62

b) Checking the health of cluster.

[root@Node1 ~]# gstatus -s

Product: RHSS v3            Capacity:  60.00 GiB(raw bricks)
Status: HEALTHY                       10.00 GiB(raw used)
Glusterfs: 3.6.0.42                      60.00 GiB(usable from volumes)
OverCommit: No                Snapshots:   0

Nodes    :  3/ 3             Volumes:  1 Up
Self Heal:  0/ 0                       0 Up(Degraded)
Bricks   :  3/ 3                       0 Up(Partial)
Clients  :     0                       0 Down

Status Messages
– Cluster is HEALTHY, all checks successful

c) Checking the information of all volumes.

[root@Node1 ~]# gstatus -v

Product: RHSS v3            Capacity:  60.00 GiB(raw bricks)
Status: HEALTHY                       10.00 GiB(raw used)
Glusterfs: 3.6.0.42                      60.00 GiB(usable from volumes)
OverCommit: No                Snapshots:   0

Volume Information
vol1             UP – 3/3 bricks up – Distribute
Capacity: (16% used) 10.00 GiB/60.00 GiB (used/total)
Snapshots: 0
Self Heal: N/A
Tasks Active: None
Protocols: glusterfs:on  NFS:on  SMB:on
Gluster Clients : 0

If we want to check for particular volume. gstatus -v <VOL NAME>

d) To take a look at self heal state.

[root@Node1 ~]# gstatus -b

Product: RHSS v3            Capacity:  60.00 GiB(raw bricks)
Status: HEALTHY                       10.00 GiB(raw used)
Glusterfs: 3.6.0.42                      60.00 GiB(usable from volumes)
OverCommit: No                Snapshots:   0

Overcommit parameter will be helpful in case of snapshots.

e) We can use gstatus -a If we want to see the whole cluster information in detail.

f) In case of troubleshooting I guess this would be the best one to check the layout of volume.

[root@Node1 ~]# gstatus -lv vol1

Product: RHSS v3            Capacity:  60.00 GiB(raw bricks)
Status: HEALTHY                       10.00 GiB(raw used)
Glusterfs: 3.6.0.42                      60.00 GiB(usable from volumes)
OverCommit: No                Snapshots:   0

Volume Information
vol1             UP – 3/3 bricks up – Distribute
Capacity: (16% used) 10.00 GiB/60.00 GiB (used/total)
Snapshots: 0
Self Heal: N/A
Tasks Active: None
Protocols: glusterfs:on  NFS:on  SMB:on
Gluster Clients : 0

vol1———— +
|
Distribute (dht)
|
+–192.168.111.9:/VolBrick1/node1(UP) 3.00 GiB/20.00 GiB
|
+–192.168.111.10:/VolBrick1n2/node2(UP) 3.00 GiB/20.00 GiB
|
+–192.168.111.11:/VolBrick1n3/node3(UP) 4.00 GiB/20.00 GiB

g) We can change the output format to json or key value pair.

[root@Node1 ~]# gstatus -v vol1 -o json
2015-02-08 12:00:16.007722 {“brick_count”: 3, “bricks_active”: 3, “client_count”: 0, “glfs_version”: “3.6.0.42”, “node_count”: 3, “nodes_active”: 3, “over_commit”: “No”, “product_name”: “Red Hat Storage Server 3.0 Update 3”, “raw_capacity”: 64078479360, “sh_active”: 0, “sh_enabled”: 0, “snapshot_count”: 0, “status”: “healthy”, “usable_capacity”: 64078479360, “used_capacity”: 10587312128, “volume_count”: 1, “volume_summary”: [{“snapshot_count”: 0, “state”: “up”, “usable_capacity”: 64078479360, “used_capacity”: 10587312128, “volume_name”: “vol1”}]}

“gstatus” is really a wonderful utility to provide the information related gluster cluster health with help of single command.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s