Skip to content

Commit

Permalink
Merge pull request etcd-io#633 from ramil600/main
Browse files Browse the repository at this point in the history
grpc_naming.md round-robin strategy
  • Loading branch information
spzala authored Mar 28, 2023
2 parents f1c652f + 6a9c8c1 commit 7ff416a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions content/en/docs/v3.5/dev-guide/grpc_naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ The etcd client's `endpoints.Manager` method can also register new endpoints wit
em := endpoints.NewManager(client, "foo/bar/my-service")
err := em.AddEndpoint(context.TODO(),"foo/bar/my-service/e1", endpoints.Endpoint{Addr:"1.2.3.4"});
```
To enable round-robin load balancing when dialing service with multiple endpoints, you can set up you connection with grpc
internal round-robin load balancer:

```go

conn, gerr := grpc.Dial("etcd:///foo", grpc.WithResolvers(etcdResolver),
grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`))
```

### Deleting an endpoint

Expand Down
8 changes: 8 additions & 0 deletions content/en/docs/v3.6/dev-guide/grpc_naming.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ The etcd client's `endpoints.Manager` method can also register new endpoints wit
em := endpoints.NewManager(client, "foo/bar/my-service")
err := em.AddEndpoint(context.TODO(),"foo/bar/my-service/e1", endpoints.Endpoint{Addr:"1.2.3.4"})
```
To enable round-robin load balancing when dialing service with multiple endpoints, you can set up you connection with grpc
internal round-robin load balancer:

```go

conn, gerr := grpc.Dial("etcd:///foo", grpc.WithResolvers(etcdResolver),
grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`))
```

### Deleting an endpoint

Expand Down

0 comments on commit 7ff416a

Please sign in to comment.