aboutsummaryrefslogtreecommitdiff
path: root/weed/command/filer.go
diff options
context:
space:
mode:
authorKonstantin Lebedev <9497591+kmlebedev@users.noreply.github.com>2022-08-05 05:35:00 +0500
committerGitHub <noreply@github.com>2022-08-04 17:35:00 -0700
commit4d08393b7ca8b1a34ed65532955de76cf8843ec2 (patch)
treeb764fe5f4b927d9b9cf1b83a2f19c87a91d81c8e /weed/command/filer.go
parent28a1f42962a3c22fa341d62e52ed014ae17c508f (diff)
downloadseaweedfs-4d08393b7ca8b1a34ed65532955de76cf8843ec2.tar.xz
seaweedfs-4d08393b7ca8b1a34ed65532955de76cf8843ec2.zip
filer prefer volume server in same data center (#3405)
* initial prefer same data center https://github.com/seaweedfs/seaweedfs/issues/3404 * GetDataCenter * prefer same data center for ReplicationSource * GetDataCenterId * remove glog
Diffstat (limited to 'weed/command/filer.go')
-rw-r--r--weed/command/filer.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index 7418a189b..888dc2d03 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -93,6 +93,7 @@ func init() {
filerS3Options.port = cmdFiler.Flag.Int("s3.port", 8333, "s3 server http listen port")
filerS3Options.portGrpc = cmdFiler.Flag.Int("s3.port.grpc", 0, "s3 server grpc listen port")
filerS3Options.domainName = cmdFiler.Flag.String("s3.domainName", "", "suffix of the host name in comma separated list, {bucket}.{domainName}")
+ filerS3Options.dataCenter = cmdFiler.Flag.String("s3.dataCenter", "", "prefer to read and write to volumes in this data center")
filerS3Options.tlsPrivateKey = cmdFiler.Flag.String("s3.key.file", "", "path to the TLS private key file")
filerS3Options.tlsCertificate = cmdFiler.Flag.String("s3.cert.file", "", "path to the TLS certificate file")
filerS3Options.config = cmdFiler.Flag.String("s3.config", "", "path to the config file")
@@ -167,6 +168,9 @@ func runFiler(cmd *Command, args []string) bool {
filerS3Options.filer = &filerAddress
filerS3Options.bindIp = f.bindIp
filerS3Options.localFilerSocket = f.localSocket
+ if *f.dataCenter != "" && *filerS3Options.dataCenter == "" {
+ filerS3Options.dataCenter = f.dataCenter
+ }
go func() {
time.Sleep(startDelay * time.Second)
filerS3Options.startS3Server()