aboutsummaryrefslogtreecommitdiff
path: root/weed/shell
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-05-06 14:12:19 -0700
committerChris Lu <chris.lu@gmail.com>2019-05-06 14:12:19 -0700
commitd01807ba05b0d40f150d933d2bded925e5443903 (patch)
tree3973c664b34e2a023454858e2b66a86d42753e98 /weed/shell
parent8ffdd5dcdb2ee0ac4c710eb01ede70fe95bf38b3 (diff)
downloadseaweedfs-d01807ba05b0d40f150d933d2bded925e5443903.tar.xz
seaweedfs-d01807ba05b0d40f150d933d2bded925e5443903.zip
shell: volume.balance add option for all_collections, each_collection
Diffstat (limited to 'weed/shell')
-rw-r--r--weed/shell/command_volume_balance.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go
index 326d2b386..0fcd95dba 100644
--- a/weed/shell/command_volume_balance.go
+++ b/weed/shell/command_volume_balance.go
@@ -64,7 +64,7 @@ func (c *commandVolumeBalance) Help() string {
func (c *commandVolumeBalance) Do(args []string, commandEnv *commandEnv, writer io.Writer) (err error) {
balanceCommand := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- collection := balanceCommand.String("c", "ALL", "collection name. use \"ALL\" for all collections")
+ collection := balanceCommand.String("c", "EACH_COLLECTION", "collection name, or use \"ALL_COLLECTIONS\" across collections, \"EACH_COLLECTION\" for each collection")
dc := balanceCommand.String("dataCenter", "", "only apply the balancing for this dataCenter")
applyBalancing := balanceCommand.Bool("f", false, "apply the balancing plan.")
if err = balanceCommand.Parse(args); err != nil {
@@ -86,7 +86,7 @@ func (c *commandVolumeBalance) Do(args []string, commandEnv *commandEnv, writer
if len(volumeServers) < 2 {
continue
}
- if *collection == "ALL" {
+ if *collection == "EACH_COLLECTION" {
collections, err := ListCollectionNames(commandEnv)
if err != nil {
return err
@@ -96,6 +96,7 @@ func (c *commandVolumeBalance) Do(args []string, commandEnv *commandEnv, writer
return err
}
}
+ } else if *collection == "ALL" {
if err = balanceVolumeServers(commandEnv, volumeServers, resp.VolumeSizeLimitMb*1024*1024, "ALL", *applyBalancing); err != nil {
return err
}