Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

shell: volume.balance add option for all_collections, each_collection

Chris Lud01807ba05b0
diff --git a/weed/command/volume.go b/weed/command/volume.go
index 4d34fbc1e4..4e350b08dc 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -64,7 +64,7 @@ func init() {
v.readRedirect = cmdVolume.Flag.Bool("read.redirect", true, "Redirect moved or non-local volumes.")
v.cpuProfile = cmdVolume.Flag.String("cpuprofile", "", "cpu profile output file")
v.memProfile = cmdVolume.Flag.String("memprofile", "", "memory profile output file")
- v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit compaction speed in mega bytes per second")
+ v.compactionMBPerSecond = cmdVolume.Flag.Int("compactionMBps", 0, "limit background compaction or copying speed in mega bytes per second")
}
var cmdVolume = &Command{
diff --git a/weed/shell/command_volume_balance.go b/weed/shell/command_volume_balance.go
index 326d2b3863..0fcd95dbaf 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
}