This is a version of the helloworld example with a server whose response includes its hostname. It also supports health and reflection services. This makes it a good server to test infrastructure, like load balancing.
This is a version of the helloworld example with a server whose response includes its hostname. It also supports health and reflection services. This makes it a good server to test infrastructure, such as XDS load balancing.
PREREQUISITES
-------------
@ -13,17 +13,87 @@ PREREQUISITES
You can also build the solution `Greeter.sln` using Visual Studio 2019,
but it's not a requirement.
BUILD AND RUN
RUN THE EXAMPLE
-------------
- Build and run the server
First, build and run the server, then verify the server is running and
check the server is behaving as expected (more on that below).
```
> dotnet run -p GreeterServer
cd GreeterServer
dotnet run
```
- Build and run the client
After configuring your xDS server to track the gRPC server we just started,
create a bootstrap file as desribed in [gRFC A27](https://github.com/grpc/proposal/blob/master/A27-xds-global-load-balancing.md):
```
> dotnet run -p GreeterClient
{
xds_servers": [
{
"server_uri": <stringcontainingURIofxdsserver>,
"channel_creds": [
{
"type": <stringcontainingchannelcredtype>,
"config": <JSONobjectcontainingconfigforthetype>
}
]
}
],
"node": <JSONformofNodeproto>
}
```
Then point the `GRPC_XDS_BOOTSTRAP` environment variable at the bootstrap file:
```
export GRPC_XDS_BOOTSTRAP=/etc/xds-bootstrap.json
```
Finally, run your client:
```
cd GreeterClient
dotnet run -- xds-experimental:///my-backend
```
VERIFYING THE SERVER
-------------
`grpcurl` can be used to test your server. If you don't have it,
install [`grpcurl`](https://github.com/fullstorydev/grpcurl/releases). This will allow