在 AWS ecs 中设置 GRPC 服务
Setting up GRPC service in AWS ecs
我尝试使用 ALB 设置 GRPC 服务器,我已经完成了所有设置 here,并且我的目标群体是健康的但是当我使用 GRPC 客户端访问服务时它失败了。下面是 GRPC 客户端日志
[ec2-user@ greeter_client]$ GRPC_GO_LOG_SEVERITY_LEVEL=info
GREETER_ENDPOINT=testgrpc-<>.us-west-1.elb.amazonaws.com:443 INSECURE=1 go
run main.go
INFO: 2022/05/08 20:43:46 [core] parsed scheme: ""
INFO: 2022/05/08 20:43:46 [core] scheme "" not registered, fallback to default scheme
INFO: 2022/05/08 20:43:46 [core] ccResolverWrapper: sending update to cc:{[{testgrpc-<>.us-west-1.elb.amazonaws.com:443 <nil> 0 <nil>}] <nil> <nil>}
INFO: 2022/05/08 20:43:46 [core] ClientConn switching balancer to "pick_first"
INFO: 2022/05/08 20:43:46 [core] Channel switches to new LB policy "pick_first"
INFO: 2022/05/08 20:43:46 [core] Subchannel Connectivity change to CONNECTING
INFO: 2022/05/08 20:43:46 [core] blockingPicker: the picked transport is not ready, loop back to repick
INFO: 2022/05/08 20:43:46 [core] Subchannel picks a new address "testgrpc-<>.us-west-1.elb.amazonaws.com:443" to connect
INFO: 2022/05/08 20:43:46 [core] Channel Connectivity change to CONNECTING
INFO: 2022/05/08 20:43:46 [core] Subchannel Connectivity change to TRANSIENT_FAILURE
INFO: 2022/05/08 20:43:46 [core] Channel Connectivity change to TRANSIENT_FAILURE
2022/05/08 20:43:46 could not greet: rpc error: code = Unavailable desc = connection closed
问题是 https 侦听器中使用的证书错误,因此执行以下操作以使其正常工作
- 将我的域名服务器移至 r53
- 在 acm 中创建了 public 个证书
- 在 https 侦听器中使用了证书
我尝试使用 ALB 设置 GRPC 服务器,我已经完成了所有设置 here,并且我的目标群体是健康的但是当我使用 GRPC 客户端访问服务时它失败了。下面是 GRPC 客户端日志
[ec2-user@ greeter_client]$ GRPC_GO_LOG_SEVERITY_LEVEL=info
GREETER_ENDPOINT=testgrpc-<>.us-west-1.elb.amazonaws.com:443 INSECURE=1 go
run main.go
INFO: 2022/05/08 20:43:46 [core] parsed scheme: ""
INFO: 2022/05/08 20:43:46 [core] scheme "" not registered, fallback to default scheme
INFO: 2022/05/08 20:43:46 [core] ccResolverWrapper: sending update to cc:{[{testgrpc-<>.us-west-1.elb.amazonaws.com:443 <nil> 0 <nil>}] <nil> <nil>}
INFO: 2022/05/08 20:43:46 [core] ClientConn switching balancer to "pick_first"
INFO: 2022/05/08 20:43:46 [core] Channel switches to new LB policy "pick_first"
INFO: 2022/05/08 20:43:46 [core] Subchannel Connectivity change to CONNECTING
INFO: 2022/05/08 20:43:46 [core] blockingPicker: the picked transport is not ready, loop back to repick
INFO: 2022/05/08 20:43:46 [core] Subchannel picks a new address "testgrpc-<>.us-west-1.elb.amazonaws.com:443" to connect
INFO: 2022/05/08 20:43:46 [core] Channel Connectivity change to CONNECTING
INFO: 2022/05/08 20:43:46 [core] Subchannel Connectivity change to TRANSIENT_FAILURE
INFO: 2022/05/08 20:43:46 [core] Channel Connectivity change to TRANSIENT_FAILURE
2022/05/08 20:43:46 could not greet: rpc error: code = Unavailable desc = connection closed
问题是 https 侦听器中使用的证书错误,因此执行以下操作以使其正常工作
- 将我的域名服务器移至 r53
- 在 acm 中创建了 public 个证书
- 在 https 侦听器中使用了证书