aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBerck Nash <berck@cloudflare.com>2022-03-17 15:25:25 -0600
committerBerck Nash <berck@cloudflare.com>2022-03-17 15:30:23 -0600
commit7ee38fa3a4ba4e849e77bde8a7356b299f9d4f7b (patch)
tree1dd0c5539e1cbe12b9411656679cf650c4948921
parent4042fdf3bb5dc9cab2f6df3911819678bbf03e01 (diff)
downloadseaweedfs-7ee38fa3a4ba4e849e77bde8a7356b299f9d4f7b.tar.xz
seaweedfs-7ee38fa3a4ba4e849e77bde8a7356b299f9d4f7b.zip
The fixes for https://github.com/chrislusf/seaweedfs/issues/1937 had a few problems:
(1) The help file says that in the absence of a ipBind being specified, that it will bind to the "ip" specified. Instead, it bound to localhost which broke the default configuration. This change implements the documented behavior instead. (2) The new IAM filer ip address has no default. This instantiates it to the same as the filer IP. I'm not sure if there should be a corresponding iam.ip or iam.ipBind option added to the filer command?
-rw-r--r--weed/command/filer.go3
-rw-r--r--weed/command/master.go2
-rw-r--r--weed/command/master_follower.go13
3 files changed, 10 insertions, 8 deletions
diff --git a/weed/command/filer.go b/weed/command/filer.go
index 36190335b..96150deb3 100644
--- a/weed/command/filer.go
+++ b/weed/command/filer.go
@@ -13,7 +13,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/security"
- "github.com/chrislusf/seaweedfs/weed/server"
+ weed_server "github.com/chrislusf/seaweedfs/weed/server"
stats_collect "github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/util"
)
@@ -103,6 +103,7 @@ func init() {
// start iam on filer
filerStartIam = cmdFiler.Flag.Bool("iam", false, "whether to start IAM service")
+ filerIamOptions.ip = f.ip
filerIamOptions.port = cmdFiler.Flag.Int("iam.port", 8111, "iam server http listen port")
}
diff --git a/weed/command/master.go b/weed/command/master.go
index a9109bdb8..9e45c5037 100644
--- a/weed/command/master.go
+++ b/weed/command/master.go
@@ -127,7 +127,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
*masterOption.portGrpc = 10000 + *masterOption.port
}
if *masterOption.ipBind == "" {
- *masterOption.ipBind = "localhost"
+ *masterOption.ipBind = *masterOption.ip
}
myMasterAddress, peers := checkPeers(*masterOption.ip, *masterOption.port, *masterOption.portGrpc, *masterOption.peers)
diff --git a/weed/command/master_follower.go b/weed/command/master_follower.go
index 502ce3cd3..f182d7ce4 100644
--- a/weed/command/master_follower.go
+++ b/weed/command/master_follower.go
@@ -3,17 +3,18 @@ package command
import (
"context"
"fmt"
+ "net/http"
+ "time"
+
"github.com/aws/aws-sdk-go/aws"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/security"
- "github.com/chrislusf/seaweedfs/weed/server"
+ weed_server "github.com/chrislusf/seaweedfs/weed/server"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/gorilla/mux"
"google.golang.org/grpc/reflection"
- "net/http"
- "time"
)
var (
@@ -45,13 +46,13 @@ var cmdMasterFollower = &Command{
Short: "start a master follower",
Long: `start a master follower to provide volume=>location mapping service
- The master follower does not participate in master election.
+ The master follower does not participate in master election.
It just follow the existing masters, and listen for any volume location changes.
In most cases, the master follower is not needed. In big data centers with thousands of volume
servers. In theory, the master may have trouble to keep up with the write requests and read requests.
- The master follower can relieve the master from from read requests, which only needs to
+ The master follower can relieve the master from from read requests, which only needs to
lookup a fileId or volumeId.
The master follower currently can handle fileId lookup requests:
@@ -112,7 +113,7 @@ func startMasterFollower(masterOptions MasterOptions) {
option.IsFollower = true
if *masterOptions.ipBind == "" {
- *masterOptions.ipBind = "localhost"
+ *masterOptions.ipBind = *masterOptions.ip
}
r := mux.NewRouter()