在AWS ECS中设置GRPC服务

huangapple go评论94阅读模式
英文:

Setting up GRPC service in AWS ecs

问题

我尝试使用ALB设置GRPC服务器,我已经完成了所有的设置这里,我的目标组也是健康的,但是当我用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

在AWS ECS中设置GRPC服务

在AWS ECS中设置GRPC服务

英文:

I tried setting up the GRPC server with ALB, I have done all the setup here, and my target groups as healthy But when I hit the service with the GRPC client it fails . below is the GRPC client log

[ec2-user@ greeter_client]$ GRPC_GO_LOG_SEVERITY_LEVEL=info 
GREETER_ENDPOINT=testgrpc-&lt;&gt;.us-west-1.elb.amazonaws.com:443 INSECURE=1  go 
run main.go
INFO: 2022/05/08 20:43:46 [core] parsed scheme: &quot;&quot;
INFO: 2022/05/08 20:43:46 [core] scheme &quot;&quot; not registered, fallback to default scheme
INFO: 2022/05/08 20:43:46 [core] ccResolverWrapper: sending update to cc:{[{testgrpc-&lt;&gt;.us-west-1.elb.amazonaws.com:443  &lt;nil&gt; 0 &lt;nil&gt;}] &lt;nil&gt; &lt;nil&gt;}
INFO: 2022/05/08 20:43:46 [core] ClientConn switching balancer to &quot;pick_first&quot;
INFO: 2022/05/08 20:43:46 [core] Channel switches to new LB policy &quot;pick_first&quot;
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 &quot;testgrpc-&lt;&gt;.us-west-1.elb.amazonaws.com:443&quot; 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

在AWS ECS中设置GRPC服务

在AWS ECS中设置GRPC服务

答案1

得分: 0

问题是https监听器中使用的证书有误,所以我采取了以下措施使其正常工作:

  1. 将我的域名服务器迁移到了R53。
  2. 在ACM中创建了公共证书。
  3. 在https监听器中使用了该证书。
英文:

the issue was certificate used in the https listener was wrong, so did following to make it work

  1. moved my nameserver to r53
  2. created public certificate in acm
  3. used certificate in the https listener

huangapple
  • 本文由 发表于 2022年5月9日 04:57:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/72165043.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定