You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/09/22 15:01:23 UTC

[GitHub] [skywalking-satellite] mrproliu opened a new pull request #68: Support load-balance GRPC client with static server list

mrproliu opened a new pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68


   Follow https://github.com/apache/skywalking/issues/7247
   Using customize GRPC resolver to implement, and using robin load-balancer to select connect on each request


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng merged pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng merged pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng commented on pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#issuecomment-925028277


   Or this is just for loading multiple-servers list?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] mrproliu commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
mrproliu commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714058938



##########
File path: plugins/client/grpc/client.go
##########
@@ -100,8 +102,15 @@ func (c *Client) Prepare() error {
 		"client_name": Name,
 	})})
 
+	// server address resolver
+	resolvers.RegisterAllGrpcResolvers()
+
 	// connect to server
-	client, err := grpc.Dial(c.ServerAddr, *cfg...)
+	target, err := resolvers.BuildTarget(&c.ServerFinderConfig)

Review comment:
       Yes, For the k8s case, there just save the Kubernetes pod/service config(by label selector), not include real address config. The static address config is a special case because we just need to specify the address list.
   We use resolver to update the server address list. Please take a look on: https://github.com/apache/skywalking-satellite/pull/68/files#diff-31cdd706c94e7a14dab4bf57861b31fc5b7e919d946fd480c593f3f18f8aafd4R69-R76




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714056338



##########
File path: plugins/client/grpc/client.go
##########
@@ -100,8 +102,15 @@ func (c *Client) Prepare() error {
 		"client_name": Name,
 	})})
 
+	// server address resolver
+	resolvers.RegisterAllGrpcResolvers()
+
 	// connect to server
-	client, err := grpc.Dial(c.ServerAddr, *cfg...)
+	target, err := resolvers.BuildTarget(&c.ServerFinderConfig)

Review comment:
       This is one of the key issue, ALS client can't dynamically routine requests to all OAP backends.
   We need to get the list periodically, and make sure the list getting updated, meanwhile all data(traces/logs/etc.) gets to be sent through one channel.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng commented on pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#issuecomment-925027223


   Could you be clear about what is the balance policy?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714050900



##########
File path: plugins/client/grpc/client.go
##########
@@ -100,8 +102,15 @@ func (c *Client) Prepare() error {
 		"client_name": Name,
 	})})
 
+	// server address resolver
+	resolvers.RegisterAllGrpcResolvers()
+
 	// connect to server
-	client, err := grpc.Dial(c.ServerAddr, *cfg...)
+	target, err := resolvers.BuildTarget(&c.ServerFinderConfig)
+	if err != nil {
+		return fmt.Errorf("cannot build grpc target: %v", err)
+	}
+	client, err := grpc.Dial(target, *cfg...)

Review comment:
       This makes me feel you have one logic client reference? Who controls the routine rule?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] mrproliu commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
mrproliu commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714065114



##########
File path: plugins/client/grpc/client_config.go
##########
@@ -73,6 +73,9 @@ func (c *Client) loadConfig() (*[]grpc.DialOption, error) {
 		return err
 	})
 
+	// using round-robin load balancer
+	options = append(options, grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`))

Review comment:
       > If so, it is OK for now, but we will need our own LB-policy implementation later. 
   
   We could customize LB-policy myself, GRPC could customize it.
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714052791



##########
File path: plugins/client/grpc/client_config.go
##########
@@ -73,6 +73,9 @@ func (c *Client) loadConfig() (*[]grpc.DialOption, error) {
 		return err
 	})
 
+	// using round-robin load balancer
+	options = append(options, grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`))

Review comment:
       If so, it is OK for now, but we will need our own LB-policy implementation later. Because this is not real protocol-oriented `round_robin`.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714054167



##########
File path: plugins/client/grpc/client.go
##########
@@ -100,8 +102,15 @@ func (c *Client) Prepare() error {
 		"client_name": Name,
 	})})
 
+	// server address resolver
+	resolvers.RegisterAllGrpcResolvers()
+
 	// connect to server
-	client, err := grpc.Dial(c.ServerAddr, *cfg...)
+	target, err := resolvers.BuildTarget(&c.ServerFinderConfig)

Review comment:
       Notice, this target could be changed dynamically. Such as in k8s, a domain name of services could have dynamic list of pods IP eventually. We need to resolve this case.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] wu-sheng commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714051485



##########
File path: plugins/client/grpc/client_config.go
##########
@@ -73,6 +73,9 @@ func (c *Client) loadConfig() (*[]grpc.DialOption, error) {
 		return err
 	})
 
+	// using round-robin load balancer
+	options = append(options, grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`))

Review comment:
       Is this the routine rule for https://github.com/apache/skywalking-satellite/pull/68/files#r714050900?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] mrproliu commented on a change in pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
mrproliu commented on a change in pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#discussion_r714054949



##########
File path: plugins/client/grpc/client_config.go
##########
@@ -73,6 +73,9 @@ func (c *Client) loadConfig() (*[]grpc.DialOption, error) {
 		return err
 	})
 
+	// using round-robin load balancer
+	options = append(options, grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`))

Review comment:
       That's true. I think it is enough for us to specify a load-balance method. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [skywalking-satellite] mrproliu commented on pull request #68: Support load-balance GRPC client with static server list

Posted by GitBox <gi...@apache.org>.
mrproliu commented on pull request #68:
URL: https://github.com/apache/skywalking-satellite/pull/68#issuecomment-925030552


   > Or this is just for loading multiple-servers list?
   
   Yes, just load-balance all existing multiple servers when sending requests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org