aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authorNico D'Cotta <45274424+Cottand@users.noreply.github.com>2023-08-24 16:08:56 +0200
committerGitHub <noreply@github.com>2023-08-24 07:08:56 -0700
commit796b7508f33916f7fa734e3df2ceea9a80415ade (patch)
tree4bc3913d93e1e328fd8f7275b11452e61d8175d2 /weed/command
parent5251b4d50ea55c5f0a2fbc60206785bf80775bac (diff)
downloadseaweedfs-796b7508f33916f7fa734e3df2ceea9a80415ade.tar.xz
seaweedfs-796b7508f33916f7fa734e3df2ceea9a80415ade.zip
Implement SRV lookups for filer (#4767)
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/benchmark.go2
-rw-r--r--weed/command/filer.go6
-rw-r--r--weed/command/server.go4
3 files changed, 6 insertions, 6 deletions
diff --git a/weed/command/benchmark.go b/weed/command/benchmark.go
index 7f132892e..7f9a23cf8 100644
--- a/weed/command/benchmark.go
+++ b/weed/command/benchmark.go
@@ -127,7 +127,7 @@ func runBenchmark(cmd *Command, args []string) bool {
defer pprof.StopCPUProfile()
}
- b.masterClient = wdclient.NewMasterClient(b.grpcDialOption, "", "client", "", "", "", pb.ServerAddresses(*b.masters).ToAddressMap())
+ b.masterClient = wdclient.NewMasterClient(b.grpcDialOption, "", "client", "", "", "", *pb.ServerAddresses(*b.masters).ToServiceDiscovery())
go b.masterClient.KeepConnectedToMaster()
b.masterClient.WaitUntilConnected()
diff --git a/weed/command/filer.go b/weed/command/filer.go
index 83e2abdac..7e636974f 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -33,7 +33,7 @@ var (
)
type FilerOptions struct {
- masters map[string]pb.ServerAddress
+ masters *pb.ServerDiscovery
mastersString *string
ip *string
bindIp *string
@@ -65,7 +65,7 @@ type FilerOptions struct {
func init() {
cmdFiler.Run = runFiler // break init cycle
- f.mastersString = cmdFiler.Flag.String("master", "localhost:9333", "comma-separated master servers")
+ f.mastersString = cmdFiler.Flag.String("master", "localhost:9333", "comma-separated master servers or a single DNS SRV record of at least 1 master server, prepended with dnssrv+")
f.filerGroup = cmdFiler.Flag.String("filerGroup", "", "share metadata with other filers in the same filerGroup")
f.collection = cmdFiler.Flag.String("collection", "", "all data will be stored in this default collection")
f.ip = cmdFiler.Flag.String("ip", util.DetectedHostAddress(), "filer server http listen ip address")
@@ -208,7 +208,7 @@ func runFiler(cmd *Command, args []string) bool {
}(startDelay)
}
- f.masters = pb.ServerAddresses(*f.mastersString).ToAddressMap()
+ f.masters = pb.ServerAddresses(*f.mastersString).ToServiceDiscovery()
f.startFiler()
diff --git a/weed/command/server.go b/weed/command/server.go
index fecb1cad6..7fbb59676 100644
--- a/weed/command/server.go
+++ b/weed/command/server.go
@@ -203,7 +203,7 @@ func runServer(cmd *Command, args []string) bool {
// ip address
masterOptions.ip = serverIp
masterOptions.ipBind = serverBindIp
- filerOptions.masters = pb.ServerAddresses(*masterOptions.peers).ToAddressMap()
+ filerOptions.masters = pb.ServerAddresses(*masterOptions.peers).ToServiceDiscovery()
filerOptions.ip = serverIp
filerOptions.bindIp = serverBindIp
s3Options.bindIp = serverBindIp
@@ -216,7 +216,7 @@ func runServer(cmd *Command, args []string) bool {
serverOptions.v.dataCenter = serverDataCenter
serverOptions.v.rack = serverRack
mqBrokerOptions.ip = serverIp
- mqBrokerOptions.masters = filerOptions.masters
+ mqBrokerOptions.masters = filerOptions.masters.GetInstancesAsMap()
mqBrokerOptions.filerGroup = filerOptions.filerGroup
// serverOptions.v.pulseSeconds = pulseSeconds