fix sftp start with filer (#7120)
* fix sftp start with filer * add bindIp
This commit is contained in:
@@ -157,6 +157,8 @@ func init() {
|
|||||||
filerSftpOptions.clientAliveInterval = cmdFiler.Flag.Duration("sftp.clientAliveInterval", 5*time.Second, "interval for sending keep-alive messages")
|
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.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.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")
|
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 {
|
if *filerStartSftp {
|
||||||
sftpOptions.filer = &filerAddress
|
filerSftpOptions.filer = &filerAddress
|
||||||
|
if *filerSftpOptions.bindIp == "" {
|
||||||
|
filerSftpOptions.bindIp = f.bindIp
|
||||||
|
}
|
||||||
if *f.dataCenter != "" && *filerSftpOptions.dataCenter == "" {
|
if *f.dataCenter != "" && *filerSftpOptions.dataCenter == "" {
|
||||||
filerSftpOptions.dataCenter = f.dataCenter
|
filerSftpOptions.dataCenter = f.dataCenter
|
||||||
}
|
}
|
||||||
go func(delay time.Duration) {
|
go func(delay time.Duration) {
|
||||||
time.Sleep(delay * time.Second)
|
time.Sleep(delay * time.Second)
|
||||||
sftpOptions.startSftpServer()
|
filerSftpOptions.startSftpServer()
|
||||||
}(startDelay)
|
}(startDelay)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user