weed server: optionally start IAM service

related to https://github.com/chrislusf/seaweedfs/issues/2560
This commit is contained in:
chrislu 2022-01-13 22:49:49 -08:00
parent 3c8b74318e
commit b17c426e99

View file

@ -28,6 +28,7 @@ var (
masterOptions MasterOptions masterOptions MasterOptions
filerOptions FilerOptions filerOptions FilerOptions
s3Options S3Options s3Options S3Options
iamOptions IamOptions
webdavOptions WebDavOption webdavOptions WebDavOption
msgBrokerOptions MessageBrokerOptions msgBrokerOptions MessageBrokerOptions
) )
@ -71,6 +72,7 @@ var (
isStartingVolumeServer = cmdServer.Flag.Bool("volume", true, "whether to start volume server") isStartingVolumeServer = cmdServer.Flag.Bool("volume", true, "whether to start volume server")
isStartingFiler = cmdServer.Flag.Bool("filer", false, "whether to start filer") isStartingFiler = cmdServer.Flag.Bool("filer", false, "whether to start filer")
isStartingS3 = cmdServer.Flag.Bool("s3", false, "whether to start S3 gateway") isStartingS3 = cmdServer.Flag.Bool("s3", false, "whether to start S3 gateway")
isStartingIam = cmdServer.Flag.Bool("iam", false, "whether to start IAM service")
isStartingWebDav = cmdServer.Flag.Bool("webdav", false, "whether to start WebDAV gateway") isStartingWebDav = cmdServer.Flag.Bool("webdav", false, "whether to start WebDAV gateway")
isStartingMsgBroker = cmdServer.Flag.Bool("msgBroker", false, "whether to start message broker") isStartingMsgBroker = cmdServer.Flag.Bool("msgBroker", false, "whether to start message broker")
@ -134,6 +136,8 @@ func init() {
s3Options.auditLogConfig = cmdServer.Flag.String("s3.auditLogConfig", "", "path to the audit log config file") s3Options.auditLogConfig = cmdServer.Flag.String("s3.auditLogConfig", "", "path to the audit log config file")
s3Options.allowEmptyFolder = cmdServer.Flag.Bool("s3.allowEmptyFolder", true, "allow empty folders") s3Options.allowEmptyFolder = cmdServer.Flag.Bool("s3.allowEmptyFolder", true, "allow empty folders")
iamOptions.port = cmdServer.Flag.Int("iam.port", 8111, "iam server http listen port")
webdavOptions.port = cmdServer.Flag.Int("webdav.port", 7333, "webdav server http listen port") webdavOptions.port = cmdServer.Flag.Int("webdav.port", 7333, "webdav server http listen port")
webdavOptions.collection = cmdServer.Flag.String("webdav.collection", "", "collection to create the files") webdavOptions.collection = cmdServer.Flag.String("webdav.collection", "", "collection to create the files")
webdavOptions.replication = cmdServer.Flag.String("webdav.replication", "", "replication to create the files") webdavOptions.replication = cmdServer.Flag.String("webdav.replication", "", "replication to create the files")
@ -161,6 +165,9 @@ func runServer(cmd *Command, args []string) bool {
if *isStartingS3 { if *isStartingS3 {
*isStartingFiler = true *isStartingFiler = true
} }
if *isStartingIam {
*isStartingFiler = true
}
if *isStartingWebDav { if *isStartingWebDav {
*isStartingFiler = true *isStartingFiler = true
} }
@ -227,25 +234,27 @@ func runServer(cmd *Command, args []string) bool {
if *isStartingFiler { if *isStartingFiler {
go func() { go func() {
time.Sleep(1 * time.Second) time.Sleep(1 * time.Second)
filerOptions.startFiler() filerOptions.startFiler()
}() }()
} }
if *isStartingS3 { if *isStartingS3 {
go func() { go func() {
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
s3Options.startS3Server() s3Options.startS3Server()
}()
}
if *isStartingIam {
go func() {
time.Sleep(2 * time.Second)
iamOptions.startIamServer()
}() }()
} }
if *isStartingWebDav { if *isStartingWebDav {
go func() { go func() {
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
webdavOptions.startWebDav() webdavOptions.startWebDav()
}() }()