aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2025-08-11 10:56:40 -0700
committerGitHub <noreply@github.com>2025-08-11 10:56:40 -0700
commit605b3333c130e04ba9b1901adc94dc871768e68d (patch)
treee8abd626dbd561f22c1ac3bf1fcb5e01d93d2db2 /weed/command/filer.go
parent9265e81fe9b600f8503cf86645d469d04ccf4685 (diff)
downloadseaweedfs-605b3333c130e04ba9b1901adc94dc871768e68d.tar.xz
seaweedfs-605b3333c130e04ba9b1901adc94dc871768e68d.zip
fix sftp start with filer (#7120)
* fix sftp start with filer * add bindIp
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index 1b7065a73..053c5a147 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -157,6 +157,8 @@ func init() {
filerSftpOptions.clientAliveInterval = cmdFiler.Flag.Duration("sftp.clientAliveInterval", 5*time.Second, "interval for sending keep-alive messages")
filerSftpOptions.clientAliveCountMax = cmdFiler.Flag.Int("sftp.clientAliveCountMax", 3, "maximum number of missed keep-alive messages before disconnecting")
filerSftpOptions.userStoreFile = cmdFiler.Flag.String("sftp.userStoreFile", "", "path to JSON file containing user credentials and permissions")
+ filerSftpOptions.dataCenter = cmdFiler.Flag.String("sftp.dataCenter", "", "prefer to read and write to volumes in this data center")
+ filerSftpOptions.bindIp = cmdFiler.Flag.String("sftp.ip.bind", "", "ip address to bind to. If empty, default to same as -ip.bind option.")
filerSftpOptions.localSocket = cmdFiler.Flag.String("sftp.localSocket", "", "default to /tmp/seaweedfs-sftp-<port>.sock")
}
@@ -256,13 +258,16 @@ func runFiler(cmd *Command, args []string) bool {
}
if *filerStartSftp {
- sftpOptions.filer = &filerAddress
+ filerSftpOptions.filer = &filerAddress
+ if *filerSftpOptions.bindIp == "" {
+ filerSftpOptions.bindIp = f.bindIp
+ }
if *f.dataCenter != "" && *filerSftpOptions.dataCenter == "" {
filerSftpOptions.dataCenter = f.dataCenter
}
go func(delay time.Duration) {
time.Sleep(delay * time.Second)
- sftpOptions.startSftpServer()
+ filerSftpOptions.startSftpServer()
}(startDelay)
}