diff options
| author | chrislusf <chris.lu@gmail.com> | 2015-02-11 21:04:43 -0800 |
|---|---|---|
| committer | chrislusf <chris.lu@gmail.com> | 2015-02-11 21:04:43 -0800 |
| commit | eff83a87d126faf0dd5b05876690271777f41e65 (patch) | |
| tree | da968af4fa066dfd281ae0ef4e6d59d806fed10e /go/weed/master.go | |
| parent | f7998f86522ef04717e22bb094f00138bdf18748 (diff) | |
| download | seaweedfs-eff83a87d126faf0dd5b05876690271777f41e65.tar.xz seaweedfs-eff83a87d126faf0dd5b05876690271777f41e65.zip | |
Add publicUrl for master server
Diffstat (limited to 'go/weed/master.go')
| -rw-r--r-- | go/weed/master.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/go/weed/master.go b/go/weed/master.go index 690662e1c..1e2a6f0af 100644 --- a/go/weed/master.go +++ b/go/weed/master.go @@ -29,8 +29,9 @@ var cmdMaster = &Command{ var ( mport = cmdMaster.Flag.Int("port", 9333, "http listen port") - masterIp = cmdMaster.Flag.String("ip", "", "master listening ip address, default to listen on all network interfaces") + masterIp = cmdMaster.Flag.String("ip", "localhost", "master <ip>|<server> address") masterBindIp = cmdMaster.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to") + mPublicUrl = cmdMaster.Flag.String("publicUrl", "", "peer accessible <ip>|<server_name>:port") metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store meta data") masterPeers = cmdMaster.Flag.String("peers", "", "other master nodes in comma separated ip:port list") volumeSizeLimitMB = cmdMaster.Flag.Uint("volumeSizeLimitMB", 30*1000, "Master stops directing writes to oversized volumes.") @@ -75,10 +76,10 @@ func runMaster(cmd *Command, args []string) bool { go func() { time.Sleep(100 * time.Millisecond) - if *masterIp == "" { - *masterIp = "localhost" - } myMasterAddress := *masterIp + ":" + strconv.Itoa(*mport) + if *mPublicUrl != "" { + myMasterAddress = *mPublicUrl + } var peers []string if *masterPeers != "" { peers = strings.Split(*masterPeers, ",") |
