mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-12-17 09:42:29 +08:00
master add separate grpc port
due to https://github.com/soheilhy/cmux/issues/64 fix https://github.com/chrislusf/seaweedfs/issues/820 fix https://github.com/chrislusf/seaweedfs/issues/840 fix https://github.com/chrislusf/seaweedfs/issues/841
This commit is contained in:
@@ -27,7 +27,12 @@ func (vs *VolumeServer) heartbeat() {
|
||||
if newLeader != "" {
|
||||
master = newLeader
|
||||
}
|
||||
newLeader, err = vs.doHeartbeat(master, time.Duration(vs.pulseSeconds)*time.Second)
|
||||
masterGrpcAddress, parseErr := util.ParseServerToGrpcAddress(master, 0)
|
||||
if parseErr != nil {
|
||||
glog.V(0).Infof("failed to parse master grpc %v", masterGrpcAddress)
|
||||
continue
|
||||
}
|
||||
newLeader, err = vs.doHeartbeat(master, masterGrpcAddress, time.Duration(vs.pulseSeconds)*time.Second)
|
||||
if err != nil {
|
||||
glog.V(0).Infof("heartbeat error: %v", err)
|
||||
time.Sleep(time.Duration(vs.pulseSeconds) * time.Second)
|
||||
@@ -36,9 +41,9 @@ func (vs *VolumeServer) heartbeat() {
|
||||
}
|
||||
}
|
||||
|
||||
func (vs *VolumeServer) doHeartbeat(masterNode string, sleepInterval time.Duration) (newLeader string, err error) {
|
||||
func (vs *VolumeServer) doHeartbeat(masterNode, masterGrpcAddress string, sleepInterval time.Duration) (newLeader string, err error) {
|
||||
|
||||
grpcConection, err := util.GrpcDial(masterNode)
|
||||
grpcConection, err := util.GrpcDial(masterGrpcAddress)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("fail to dial %s : %v", masterNode, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user