glusterd2
glusterd2 copied to clipboard
Adding glustercli command to get options of all volumes
Fixes:https://github.com/gluster/glusterd2/issues/1385 Signed-off-by: rishubhjain [email protected]
@Madhu-1 @atinmu Please review
retest this please
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 |
+-------------------------------+----------+--------+---------------+--------------+
retest this please
[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?
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 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
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
[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 |
+--------------------------------+----------+-------+---------------+
[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 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>
.
@Madhu-1 Are we good with this PR?
Can we please close down this PR today? It's been hanging around for a while now :-)
@rishubhjain please address the comments and rebase
@aravindavk Is this a GCS 1.0 blocker?