1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-09-15 13:30:36 +02:00

Add publicUrl for master server

This commit is contained in:
chrislusf 2015-02-11 21:04:43 -08:00
parent f7998f8652
commit eff83a87d1
3 changed files with 7 additions and 10 deletions

View file

@ -1,5 +1,5 @@
package util
const (
VERSION = "0.68"
VERSION = "0.69 beta"
)

View file

@ -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, ",")

View file

@ -47,7 +47,7 @@ var cmdServer = &Command{
}
var (
serverIp = cmdServer.Flag.String("ip", "", "ip or server name")
serverIp = cmdServer.Flag.String("ip", "localhost", "ip or server name")
serverPublicUrl = cmdServer.Flag.String("publicUrl", "", "publicly accessible address")
serverBindIp = cmdServer.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
serverMaxCpu = cmdServer.Flag.Int("maxCpu", 0, "maximum number of CPUs. 0 means all available CPUs")
@ -99,10 +99,6 @@ func runServer(cmd *Command, args []string) bool {
defer pprof.StopCPUProfile()
}
if *serverIp == "" {
*serverIp = "localhost"
}
if *filerOptions.redirectOnRead {
*isStartingFiler = true
}