mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-08-20 06:35:56 +08:00
fix sftp start with filer (#7120)
* fix sftp start with filer * add bindIp
This commit is contained in:
parent
9265e81fe9
commit
605b3333c1
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user