aboutsummaryrefslogtreecommitdiff
path: root/weed/operation/grpc_client.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-01-18 14:14:47 -0800
committerChris Lu <chris.lu@gmail.com>2019-01-18 14:14:47 -0800
commit67e2ea72be5b0f5bb1f69967165a279cc3067938 (patch)
tree81c0b0e446222cf3b522a495d2761329aab044b4 /weed/operation/grpc_client.go
parentdfae0f4e9df1c1b041d6c4f1f13d885bd86f0e20 (diff)
downloadseaweedfs-67e2ea72be5b0f5bb1f69967165a279cc3067938.tar.xz
seaweedfs-67e2ea72be5b0f5bb1f69967165a279cc3067938.zip
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
Diffstat (limited to 'weed/operation/grpc_client.go')
-rw-r--r--weed/operation/grpc_client.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/operation/grpc_client.go b/weed/operation/grpc_client.go
index 300f78b58..d0931a8d3 100644
--- a/weed/operation/grpc_client.go
+++ b/weed/operation/grpc_client.go
@@ -44,9 +44,14 @@ func toVolumeServerGrpcAddress(volumeServer string) (grpcAddress string, err err
func withMasterServerClient(masterServer string, fn func(masterClient master_pb.SeaweedClient) error) error {
+ masterGrpcAddress, parseErr := util.ParseServerToGrpcAddress(masterServer, 0)
+ if parseErr != nil {
+ return fmt.Errorf("failed to parse master grpc %v", masterServer)
+ }
+
return util.WithCachedGrpcClient(func(grpcConnection *grpc.ClientConn) error {
client := master_pb.NewSeaweedClient(grpcConnection)
return fn(client)
- }, masterServer)
+ }, masterGrpcAddress)
}