Add "-ip.bind" option when starting volume servers.

Also some Weed->Seaweed changes.
This commit is contained in:
Chris Lu 2014-09-20 23:30:35 -07:00
parent ca16cfa147
commit ba179b1542
3 changed files with 9 additions and 7 deletions

View File

@ -63,7 +63,7 @@ func runMaster(cmd *Command, args []string) bool {
listeningAddress := *masterIp + ":" + strconv.Itoa(*mport)
glog.V(0).Infoln("Start Weed Master", util.VERSION, "at", listeningAddress)
glog.V(0).Infoln("Start Seaweed Master", util.VERSION, "at", listeningAddress)
listener, e := util.NewListener(listeningAddress, time.Duration(*mTimeout)*time.Second)
if e != nil {

View File

@ -48,6 +48,7 @@ var cmdServer = &Command{
var (
serverIp = cmdServer.Flag.String("ip", "", "ip or server name")
serverPublicIp = cmdServer.Flag.String("publicIp", "", "ip or server name")
serverBindIp = cmdVolume.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")
serverTimeout = cmdServer.Flag.Int("idleTimeout", 10, "connection idle seconds")
serverDataCenter = cmdServer.Flag.String("dataCenter", "", "current volume server's data center name")
@ -178,8 +179,8 @@ func runServer(cmd *Command, args []string) bool {
*masterVolumeSizeLimitMB, *volumePulse, *masterConfFile, *masterDefaultReplicaPlacement, *serverGarbageThreshold, serverWhiteList,
)
glog.V(0).Infoln("Start Weed Master", util.VERSION, "at", *serverIp+":"+strconv.Itoa(*masterPort))
masterListener, e := util.NewListener(*serverIp+":"+strconv.Itoa(*masterPort), time.Duration(*serverTimeout)*time.Second)
glog.V(0).Infoln("Start Seaweed Master", util.VERSION, "at", *serverIp+":"+strconv.Itoa(*masterPort))
masterListener, e := util.NewListener(*serverBindIp+":"+strconv.Itoa(*masterPort), time.Duration(*serverTimeout)*time.Second)
if e != nil {
glog.Fatalf(e.Error())
}
@ -211,9 +212,9 @@ func runServer(cmd *Command, args []string) bool {
*volumeFixJpgOrientation,
)
glog.V(0).Infoln("Start Weed volume server", util.VERSION, "at", *serverIp+":"+strconv.Itoa(*volumePort))
glog.V(0).Infoln("Start Seaweed volume server", util.VERSION, "at", *serverIp+":"+strconv.Itoa(*volumePort))
volumeListener, e := util.NewListener(
*serverIp+":"+strconv.Itoa(*volumePort),
*serverBindIp+":"+strconv.Itoa(*volumePort),
time.Duration(*serverTimeout)*time.Second,
)
if e != nil {

View File

@ -30,6 +30,7 @@ var (
maxVolumeCounts = cmdVolume.Flag.String("max", "7", "maximum numbers of volumes, count[,count]...")
ip = cmdVolume.Flag.String("ip", "", "ip or server name")
publicIp = cmdVolume.Flag.String("publicIp", "", "Publicly accessible <ip|server_name>")
bindIp = cmdVolume.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
masterNode = cmdVolume.Flag.String("mserver", "localhost:9333", "master server location")
vpulse = cmdVolume.Flag.Int("pulseSeconds", 5, "number of seconds between heartbeats, must be smaller than or equal to the master's setting")
vTimeout = cmdVolume.Flag.Int("idleTimeout", 10, "connection idle seconds")
@ -84,9 +85,9 @@ func runVolume(cmd *Command, args []string) bool {
*fixJpgOrientation,
)
listeningAddress := *ip + ":" + strconv.Itoa(*vport)
listeningAddress := *bindIp + ":" + strconv.Itoa(*vport)
glog.V(0).Infoln("Start Weed volume server", util.VERSION, "at", listeningAddress)
glog.V(0).Infoln("Start Seaweed volume server", util.VERSION, "at", listeningAddress)
listener, e := util.NewListener(listeningAddress, time.Duration(*vTimeout)*time.Second)
if e != nil {