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.

Fix the issue where fuse command on a node cannot specify multiple configuration directory paths (#7874)

云天飞镜e8a41ec053b6
diff --git a/weed/command/fuse.go b/weed/command/fuse.go
index a3b7fb81e9..6a6dd8d5dd 100644
--- a/weed/command/fuse.go
+++ b/weed/command/fuse.go
@@ -28,3 +28,7 @@ var cmdFuse = &Command{
To check valid options look "weed mount --help"
`,
}
+
+func GetFuseCommandName() string {
+ return cmdFuse.Name()
+}
diff --git a/weed/command/fuse_std.go b/weed/command/fuse_std.go
index 2cc6fa8ab5..bd274f651b 100644
--- a/weed/command/fuse_std.go
+++ b/weed/command/fuse_std.go
@@ -12,6 +12,9 @@ import (
"strings"
"syscall"
"time"
+
+ "github.com/seaweedfs/seaweedfs/weed/util"
+ util_http "github.com/seaweedfs/seaweedfs/weed/util/http"
)
type parameter struct {
@@ -219,6 +222,8 @@ func runFuse(cmd *Command, args []string) bool {
}
case "fusermount.path":
fusermountPath = parameter.value
+ case "config_dir":
+ util.ConfigurationFileDirectory.Set(parameter.value)
default:
t := parameter.name
if parameter.value != "true" {
@@ -228,6 +233,8 @@ func runFuse(cmd *Command, args []string) bool {
}
}
+ util_http.InitGlobalHttpClient()
+
// the master start the child, release it then finish himself
if masterProcess {
arg0, err := os.Executable()
diff --git a/weed/weed.go b/weed/weed.go
index cde071179c..f940cdacd2 100644
--- a/weed/weed.go
+++ b/weed/weed.go
@@ -85,8 +85,9 @@ func main() {
}
return
}
-
- util_http.InitGlobalHttpClient()
+ if args[0] != command.GetFuseCommandName() {
+ util_http.InitGlobalHttpClient()
+ }
for _, cmd := range commands {
if cmd.Name() == args[0] && cmd.Run != nil {
cmd.Flag.Usage = func() { cmd.Usage() }