aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-10-06 09:05:30 -0700
committerChris Lu <chris.lu@gmail.com>2020-10-06 09:05:30 -0700
commitc543762e23d5f38dc90365f6e9c04abc5aa5c0d4 (patch)
treed61413450953308fcc14088fa49d393ab29612a9
parent36492c47ec71b7c229b213118a9241d6e9bedf71 (diff)
downloadseaweedfs-c543762e23d5f38dc90365f6e9c04abc5aa5c0d4.tar.xz
seaweedfs-c543762e23d5f38dc90365f6e9c04abc5aa5c0d4.zip
volume: auto expands -max setting
I have tried to run weed volume but got errors... cmd: weed volume -max=0 -mserver="127.0.0.1:9333" -port=8080 -dir="/var/www/d1/sfs,/var/www/d2/sfs,/var/www/d3/sfs" log: I1006 15:09:26 17040 file_util.go:23] Folder /var/www/d1/sfs Permission: -rwxr-xr-x I1006 15:09:26 17040 file_util.go:23] Folder /var/www/d2/sfs Permission: -rwxr-xr-x I1006 15:09:26 17040 file_util.go:23] Folder /var/www/d3/sfs Permission: -rwxr-xr-x F1006 15:09:26 17040 volume.go:142] 3 directories by -dir, but only 1 max is set by -max What am I doing wrong? Thx.
-rw-r--r--weed/command/volume.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/command/volume.go b/weed/command/volume.go
index dfc649ba5..d73c24ed1 100644
--- a/weed/command/volume.go
+++ b/weed/command/volume.go
@@ -138,6 +138,11 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v
glog.Fatalf("The max specified in -max not a valid number %s", maxString)
}
}
+ if len(v.folderMaxLimits) == 1 && len(v.folders) > 1 {
+ for i := 0; i < len(v.folders)-1; i++ {
+ v.folderMaxLimits = append(v.folderMaxLimits, v.folderMaxLimits[0])
+ }
+ }
if len(v.folders) != len(v.folderMaxLimits) {
glog.Fatalf("%d directories by -dir, but only %d max is set by -max", len(v.folders), len(v.folderMaxLimits))
}