mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
custom grpc port: master
This commit is contained in:
parent
7591336a22
commit
bd1f800efe
|
@ -27,6 +27,7 @@ var (
|
||||||
|
|
||||||
type MasterOptions struct {
|
type MasterOptions struct {
|
||||||
port *int
|
port *int
|
||||||
|
portGrpc *int
|
||||||
ip *string
|
ip *string
|
||||||
ipBind *string
|
ipBind *string
|
||||||
metaFolder *string
|
metaFolder *string
|
||||||
|
@ -46,6 +47,7 @@ type MasterOptions struct {
|
||||||
func init() {
|
func init() {
|
||||||
cmdMaster.Run = runMaster // break init cycle
|
cmdMaster.Run = runMaster // break init cycle
|
||||||
m.port = cmdMaster.Flag.Int("port", 9333, "http listen port")
|
m.port = cmdMaster.Flag.Int("port", 9333, "http listen port")
|
||||||
|
m.portGrpc = cmdMaster.Flag.Int("port.grpc", 19333, "grpc listen port")
|
||||||
m.ip = cmdMaster.Flag.String("ip", util.DetectedHostAddress(), "master <ip>|<server> address, also used as identifier")
|
m.ip = cmdMaster.Flag.String("ip", util.DetectedHostAddress(), "master <ip>|<server> address, also used as identifier")
|
||||||
m.ipBind = cmdMaster.Flag.String("ip.bind", "", "ip address to bind to")
|
m.ipBind = cmdMaster.Flag.String("ip.bind", "", "ip address to bind to")
|
||||||
m.metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store meta data")
|
m.metaFolder = cmdMaster.Flag.String("mdir", os.TempDir(), "data directory to store meta data")
|
||||||
|
@ -130,7 +132,7 @@ func startMaster(masterOption MasterOptions, masterWhiteList []string) {
|
||||||
ms.SetRaftServer(raftServer)
|
ms.SetRaftServer(raftServer)
|
||||||
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")
|
r.HandleFunc("/cluster/status", raftServer.StatusHandler).Methods("GET")
|
||||||
// starting grpc server
|
// starting grpc server
|
||||||
grpcPort := *masterOption.port + 10000
|
grpcPort := *masterOption.portGrpc
|
||||||
grpcL, err := util.NewListener(util.JoinHostPort(*masterOption.ipBind, grpcPort), 0)
|
grpcL, err := util.NewListener(util.JoinHostPort(*masterOption.ipBind, grpcPort), 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalf("master failed to listen on grpc port %d: %v", grpcPort, err)
|
glog.Fatalf("master failed to listen on grpc port %d: %v", grpcPort, err)
|
||||||
|
|
|
@ -85,6 +85,7 @@ func init() {
|
||||||
serverOptions.debugPort = cmdServer.Flag.Int("debug.port", 6060, "http port for debugging")
|
serverOptions.debugPort = cmdServer.Flag.Int("debug.port", 6060, "http port for debugging")
|
||||||
|
|
||||||
masterOptions.port = cmdServer.Flag.Int("master.port", 9333, "master server http listen port")
|
masterOptions.port = cmdServer.Flag.Int("master.port", 9333, "master server http listen port")
|
||||||
|
masterOptions.portGrpc = cmdServer.Flag.Int("master.port.grpc", 19333, "master server grpc listen port")
|
||||||
masterOptions.metaFolder = cmdServer.Flag.String("master.dir", "", "data directory to store meta data, default to same as -dir specified")
|
masterOptions.metaFolder = cmdServer.Flag.String("master.dir", "", "data directory to store meta data, default to same as -dir specified")
|
||||||
masterOptions.peers = cmdServer.Flag.String("master.peers", "", "all master nodes in comma separated ip:masterPort list")
|
masterOptions.peers = cmdServer.Flag.String("master.peers", "", "all master nodes in comma separated ip:masterPort list")
|
||||||
masterOptions.volumeSizeLimitMB = cmdServer.Flag.Uint("master.volumeSizeLimitMB", 30*1000, "Master stops directing writes to oversized volumes.")
|
masterOptions.volumeSizeLimitMB = cmdServer.Flag.Uint("master.volumeSizeLimitMB", 30*1000, "Master stops directing writes to oversized volumes.")
|
||||||
|
|
Loading…
Reference in a new issue