mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer: add -ip.bind option
This commit is contained in:
parent
5c348087dc
commit
cf54d70311
|
@ -23,6 +23,7 @@ var (
|
||||||
type FilerOptions struct {
|
type FilerOptions struct {
|
||||||
masters *string
|
masters *string
|
||||||
ip *string
|
ip *string
|
||||||
|
bindIp *string
|
||||||
port *int
|
port *int
|
||||||
publicPort *int
|
publicPort *int
|
||||||
collection *string
|
collection *string
|
||||||
|
@ -44,6 +45,7 @@ func init() {
|
||||||
f.masters = cmdFiler.Flag.String("master", "localhost:9333", "comma-separated master servers")
|
f.masters = cmdFiler.Flag.String("master", "localhost:9333", "comma-separated master servers")
|
||||||
f.collection = cmdFiler.Flag.String("collection", "", "all data will be stored in this collection")
|
f.collection = cmdFiler.Flag.String("collection", "", "all data will be stored in this collection")
|
||||||
f.ip = cmdFiler.Flag.String("ip", util.DetectedHostAddress(), "filer server http listen ip address")
|
f.ip = cmdFiler.Flag.String("ip", util.DetectedHostAddress(), "filer server http listen ip address")
|
||||||
|
f.bindIp = cmdFiler.Flag.String("ip.bind", "0.0.0.0", "ip address to bind to")
|
||||||
f.port = cmdFiler.Flag.Int("port", 8888, "filer server http listen port")
|
f.port = cmdFiler.Flag.Int("port", 8888, "filer server http listen port")
|
||||||
f.publicPort = cmdFiler.Flag.Int("port.readonly", 0, "readonly port opened to public")
|
f.publicPort = cmdFiler.Flag.Int("port.readonly", 0, "readonly port opened to public")
|
||||||
f.defaultReplicaPlacement = cmdFiler.Flag.String("defaultReplicaPlacement", "000", "default replication type if not specified")
|
f.defaultReplicaPlacement = cmdFiler.Flag.String("defaultReplicaPlacement", "000", "default replication type if not specified")
|
||||||
|
@ -118,7 +120,7 @@ func (fo *FilerOptions) startFiler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if *fo.publicPort != 0 {
|
if *fo.publicPort != 0 {
|
||||||
publicListeningAddress := *fo.ip + ":" + strconv.Itoa(*fo.publicPort)
|
publicListeningAddress := *fo.bindIp + ":" + strconv.Itoa(*fo.publicPort)
|
||||||
glog.V(0).Infoln("Start Seaweed filer server", util.VERSION, "public at", publicListeningAddress)
|
glog.V(0).Infoln("Start Seaweed filer server", util.VERSION, "public at", publicListeningAddress)
|
||||||
publicListener, e := util.NewListener(publicListeningAddress, 0)
|
publicListener, e := util.NewListener(publicListeningAddress, 0)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
|
@ -133,7 +135,7 @@ func (fo *FilerOptions) startFiler() {
|
||||||
|
|
||||||
glog.V(0).Infof("Start Seaweed Filer %s at %s:%d", util.VERSION, *fo.ip, *fo.port)
|
glog.V(0).Infof("Start Seaweed Filer %s at %s:%d", util.VERSION, *fo.ip, *fo.port)
|
||||||
filerListener, e := util.NewListener(
|
filerListener, e := util.NewListener(
|
||||||
*fo.ip+":"+strconv.Itoa(*fo.port),
|
*fo.bindIp+":"+strconv.Itoa(*fo.port),
|
||||||
time.Duration(10)*time.Second,
|
time.Duration(10)*time.Second,
|
||||||
)
|
)
|
||||||
if e != nil {
|
if e != nil {
|
||||||
|
|
|
@ -125,7 +125,8 @@ func runServer(cmd *Command, args []string) bool {
|
||||||
masterOptions.ip = serverIp
|
masterOptions.ip = serverIp
|
||||||
masterOptions.ipBind = serverBindIp
|
masterOptions.ipBind = serverBindIp
|
||||||
filerOptions.masters = &peers
|
filerOptions.masters = &peers
|
||||||
filerOptions.ip = serverBindIp
|
filerOptions.ip = serverIp
|
||||||
|
filerOptions.bindIp = serverBindIp
|
||||||
serverOptions.v.ip = serverIp
|
serverOptions.v.ip = serverIp
|
||||||
serverOptions.v.bindIp = serverBindIp
|
serverOptions.v.bindIp = serverBindIp
|
||||||
serverOptions.v.masters = &peers
|
serverOptions.v.masters = &peers
|
||||||
|
|
Loading…
Reference in a new issue