glusterd2 icon indicating copy to clipboard operation
glusterd2 copied to clipboard

Adding glustercli command to get options of all volumes

Open rishubhjain opened this issue 6 years ago • 15 comments

Fixes:https://github.com/gluster/glusterd2/issues/1385 Signed-off-by: rishubhjain [email protected]

rishubhjain avatar Dec 14 '18 01:12 rishubhjain

@Madhu-1 @atinmu Please review

rishubhjain avatar Dec 14 '18 01:12 rishubhjain

retest this please

Madhu-1 avatar Dec 14 '18 03:12 Madhu-1

Volume option for all volumes :

[root@localhost glusterd2]# ./build/glustercli volume get all all
Volume : testvol1
+-------------------------------+----------+--------+---------------+--------------+
|             NAME              | MODIFIED | VALUE  | DEFAULT VALUE | OPTION LEVEL |
+-------------------------------+----------+--------+---------------+--------------+
| nufa.lookup-unhashed          | no       | on     | on            | Basic        |
| nufa.min-free-disk            | no       | 10%    | 10%           | Basic        |
| nufa.min-free-inodes          | no       | 5%     | 5%            | Basic        |
| nufa.rebalance-stats          | no       | off    | off           | Basic        |
| nufa.rsync-hash-regex         | no       |        |               | Basic        |
| nufa.extra-hash-regex         | no       |        |               | Basic        |
| nufa.weighted-rebalance       | no       | on     | on            | Basic        |
| nufa.rebal-throttle           | no       | normal | normal        | Basic        |
| distribute.lookup-unhashed    | no       | on     | on            | Basic        |
| distribute.min-free-disk      | no       | 10%    | 10%           | Basic        |
| distribute.min-free-inodes    | no       | 5%     | 5%            | Basic        |
| distribute.rebalance-stats    | no       | off    | off           | Basic        |
| distribute.rsync-hash-regex   | no       |        |               | Basic        |
| distribute.extra-hash-regex   | no       |        |               | Basic        |
| distribute.weighted-rebalance | no       | on     | on            | Basic        |
| distribute.rebal-throttle     | no       | normal | normal        | Basic        |
| changelog.changelog           | no       | off    | off           | Basic        |
| changelog.capture-del-path    | no       | off    | off           | Basic        |
| switch.lookup-unhashed        | no       | on     | on            | Basic        |
| switch.min-free-disk          | no       | 10%    | 10%           | Basic        |
| switch.min-free-inodes        | no       | 5%     | 5%            | Basic        |
| switch.rebalance-stats        | no       | off    | off           | Basic        |
| switch.rsync-hash-regex       | no       |        |               | Basic        |
| switch.extra-hash-regex       | no       |        |               | Basic        |
| switch.weighted-rebalance     | no       | on     | on            | Basic        |
| switch.rebal-throttle         | no       | normal | normal        | Basic        |
| quota.enable                  | no       | off    | off           | Basic        |
+-------------------------------+----------+--------+---------------+--------------+
Volume : testvol2
+-------------------------------+----------+--------+---------------+--------------+
|             NAME              | MODIFIED | VALUE  | DEFAULT VALUE | OPTION LEVEL |
+-------------------------------+----------+--------+---------------+--------------+
| quota.enable                  | no       | off    | off           | Basic        |
| nufa.lookup-unhashed          | no       | on     | on            | Basic        |
| nufa.min-free-disk            | no       | 10%    | 10%           | Basic        |
| nufa.min-free-inodes          | no       | 5%     | 5%            | Basic        |
| nufa.rebalance-stats          | no       | off    | off           | Basic        |
| nufa.rsync-hash-regex         | no       |        |               | Basic        |
| nufa.extra-hash-regex         | no       |        |               | Basic        |
| nufa.weighted-rebalance       | no       | on     | on            | Basic        |
| nufa.rebal-throttle           | no       | normal | normal        | Basic        |
| distribute.lookup-unhashed    | no       | on     | on            | Basic        |
| distribute.min-free-disk      | no       | 10%    | 10%           | Basic        |
| distribute.min-free-inodes    | no       | 5%     | 5%            | Basic        |
| distribute.rebalance-stats    | no       | off    | off           | Basic        |
| distribute.rsync-hash-regex   | no       |        |               | Basic        |
| distribute.extra-hash-regex   | no       |        |               | Basic        |
| distribute.weighted-rebalance | no       | on     | on            | Basic        |
| distribute.rebal-throttle     | no       | normal | normal        | Basic        |
| changelog.changelog           | no       | off    | off           | Basic        |
| changelog.capture-del-path    | no       | off    | off           | Basic        |
| switch.lookup-unhashed        | no       | on     | on            | Basic        |
| switch.min-free-disk          | no       | 10%    | 10%           | Basic        |
| switch.min-free-inodes        | no       | 5%     | 5%            | Basic        |
| switch.rebalance-stats        | no       | off    | off           | Basic        |
| switch.rsync-hash-regex       | no       |        |               | Basic        |
| switch.extra-hash-regex       | no       |        |               | Basic        |
| switch.weighted-rebalance     | no       | on     | on            | Basic        |
| switch.rebal-throttle         | no       | normal | normal        | Basic        |
+-------------------------------+----------+--------+---------------+--------------+

Volume option for one volume:

[root@localhost glusterd2]# ./build/glustercli volume get testvol1 all
Volume : testvol1
+-------------------------------+----------+--------+---------------+--------------+
|             NAME              | MODIFIED | VALUE  | DEFAULT VALUE | OPTION LEVEL |
+-------------------------------+----------+--------+---------------+--------------+
| changelog.changelog           | no       | off    | off           | Basic        |
| changelog.capture-del-path    | no       | off    | off           | Basic        |
| switch.lookup-unhashed        | no       | on     | on            | Basic        |
| switch.min-free-disk          | no       | 10%    | 10%           | Basic        |
| switch.min-free-inodes        | no       | 5%     | 5%            | Basic        |
| switch.rebalance-stats        | no       | off    | off           | Basic        |
| switch.rsync-hash-regex       | no       |        |               | Basic        |
| switch.extra-hash-regex       | no       |        |               | Basic        |
| switch.weighted-rebalance     | no       | on     | on            | Basic        |
| switch.rebal-throttle         | no       | normal | normal        | Basic        |
| quota.enable                  | no       | off    | off           | Basic        |
| nufa.lookup-unhashed          | no       | on     | on            | Basic        |
| nufa.min-free-disk            | no       | 10%    | 10%           | Basic        |
| nufa.min-free-inodes          | no       | 5%     | 5%            | Basic        |
| nufa.rebalance-stats          | no       | off    | off           | Basic        |
| nufa.rsync-hash-regex         | no       |        |               | Basic        |
| nufa.extra-hash-regex         | no       |        |               | Basic        |
| nufa.weighted-rebalance       | no       | on     | on            | Basic        |
| nufa.rebal-throttle           | no       | normal | normal        | Basic        |
| distribute.lookup-unhashed    | no       | on     | on            | Basic        |
| distribute.min-free-disk      | no       | 10%    | 10%           | Basic        |
| distribute.min-free-inodes    | no       | 5%     | 5%            | Basic        |
| distribute.rebalance-stats    | no       | off    | off           | Basic        |
| distribute.rsync-hash-regex   | no       |        |               | Basic        |
| distribute.extra-hash-regex   | no       |        |               | Basic        |
| distribute.weighted-rebalance | no       | on     | on            | Basic        |
| distribute.rebal-throttle     | no       | normal | normal        | Basic        |
+-------------------------------+----------+--------+---------------+--------------+

rishubhjain avatar Dec 14 '18 03:12 rishubhjain

retest this please

rishubhjain avatar Dec 14 '18 03:12 rishubhjain

[root@localhost glusterd2]# ./build/glustercli volume get testvol1 all +-------------------------------+----------+--------+---------------+--------------+ | NAME | MODIFIED | VALUE | DEFAULT VALUE | OPTION LEVEL | +-------------------------------+----------+--------+---------------+--------------+ | changelog.changelog | no | off | off | Basic | | changelog.capture-del-path | no | off | off | Basic | | quota.enable | no | off | off | Basic | | distribute.lookup-unhashed | no | on | on | Basic | | distribute.min-free-disk | no | 10% | 10% | Basic | | distribute.min-free-inodes | no | 5% | 5% | Basic | | distribute.rebalance-stats | no | off | off | Basic | | distribute.rsync-hash-regex | no | | | Basic | | distribute.extra-hash-regex | no | | | Basic | | distribute.weighted-rebalance | no | on | on | Basic | | distribute.rebal-throttle | no | normal | normal | Basic | | nufa.lookup-unhashed | no | on | on | Basic | | nufa.min-free-disk | no | 10% | 10% | Basic | | nufa.min-free-inodes | no | 5% | 5% | Basic | | nufa.rebalance-stats | no | off | off | Basic | | nufa.rsync-hash-regex | no | | | Basic | | nufa.extra-hash-regex | no | | | Basic | | nufa.weighted-rebalance | no | on | on | Basic | | nufa.rebal-throttle | no | normal | normal | Basic | | switch.lookup-unhashed | no | on | on | Basic | | switch.min-free-disk | no | 10% | 10% | Basic | | switch.min-free-inodes | no | 5% | 5% | Basic | | switch.rebalance-stats | no | off | off | Basic | | switch.rsync-hash-regex | no | | | Basic | | switch.extra-hash-regex | no | | | Basic | | switch.weighted-rebalance | no | on | on | Basic | | switch.rebal-throttle | no | normal | normal | Basic | +-------------------------------+----------+--------+---------------+--------------+

am i missing anything, the table you declared as the volume name field, but its missing here?

Madhu-1 avatar Dec 14 '18 03:12 Madhu-1

For uniformity you can retain "Volume name" even in single volume output. Or follow convention similar to volume status

volume: <name>
TABLE

volume: <name>
TABLE

aravindavk avatar Dec 14 '18 04:12 aravindavk

@aravindavk Made the changes, can you check if this is what you wanted? @Madhu-1 @aravindavk The new output is https://github.com/gluster/glusterd2/pull/1406#issuecomment-447204640

rishubhjain avatar Dec 14 '18 13:12 rishubhjain

Issue #1385 talks about showing cluster options. But this PR only includes showing options of all volumes. Cluster options are available in https://github.com/gluster/glusterd2/blob/master/glusterd2/commands/options/commands.go#L25 and the list of valid options are maintained here https://github.com/gluster/glusterd2/blob/master/glusterd2/options/cluster.go#L29

aravindavk avatar Dec 14 '18 15:12 aravindavk

[root@localhost glusterd2]# ./build/glustercli cluster get
+--------------------------------+----------+-------+---------------+
|              NAME              | MODIFIED | VALUE | DEFAULT VALUE |
+--------------------------------+----------+-------+---------------+
| cluster.brick-multiplex        | no       | off   | off           |
| cluster.max-bricks-per-process | no       | 0     | 0             |
| cluster.localtime-logging      | no       | off   | off           |
| cluster.shared-storage         | no       | off   | off           |
| cluster.op-version             | no       | 50000 | 50000         |
| cluster.max-op-version         | no       | 50000 | 50000         |
+--------------------------------+----------+-------+---------------+
[root@localhost glusterd2]# ./build/glustercli cluster set cluster.brick-multiplex 1000
Options set successfully 
[root@localhost glusterd2]# ./build/glustercli cluster get
+--------------------------------+----------+-------+---------------+
|              NAME              | MODIFIED | VALUE | DEFAULT VALUE |
+--------------------------------+----------+-------+---------------+
| cluster.shared-storage         | no       | off   | off           |
| cluster.op-version             | no       | 50000 | 50000         |
| cluster.max-op-version         | no       | 50000 | 50000         |
| cluster.brick-multiplex        | yes      | 1000  | off           |
| cluster.max-bricks-per-process | no       | 0     | 0             |
| cluster.localtime-logging      | no       | off   | off           |
+--------------------------------+----------+-------+---------------+

rishubhjain avatar Dec 15 '18 14:12 rishubhjain

[root@localhost glusterd2]# ./build/glustercli cluster get +--------------------------------+----------+-------+---------------+ | NAME | MODIFIED | VALUE | DEFAULT VALUE | +--------------------------------+----------+-------+---------------+ | cluster.shared-storage | no | off | off | | cluster.op-version | no | 50000 | 50000 | | cluster.max-op-version | no | 50000 | 50000 | | cluster.brick-multiplex | yes | 1000 | off | | cluster.max-bricks-per-process | no | 0 | 0 | | cluster.localtime-logging | no | off | off | +--------------------------------+----------+-------+---------------+

Can we please clean up the global option tables with all the unwanted options which were defined as place holders to begin in. For eg : cluster.localtime-logging , cluster.shared-storage are not applicable. Also cluster.op-version, cluster,max-op-version values need change and it should stay with current glusterfs master.

Also I'm not particularly sure about if the cli naming convention is correct here. glustercli cluster get doesn't give a proper meaning. Would like to hear thoughts from @aravindavk @kshlm on this.

atinmu avatar Dec 17 '18 04:12 atinmu

@atinmu Regarding cli naming convention in https://github.com/gluster/glusterd2/pull/1406#issuecomment-447716617, I tried to keep it uniform with volume options glustercli volume get <volname>.

rishubhjain avatar Dec 18 '18 11:12 rishubhjain

@Madhu-1 Are we good with this PR?

atinmu avatar Jan 04 '19 06:01 atinmu

Can we please close down this PR today? It's been hanging around for a while now :-)

atinmu avatar Jan 07 '19 05:01 atinmu

@rishubhjain please address the comments and rebase

aravindavk avatar Jan 29 '19 03:01 aravindavk

@aravindavk Is this a GCS 1.0 blocker?

rishubhjain avatar Jan 29 '19 06:01 rishubhjain