我正在使用 Ruby 构建 gRPC服务器,并尝试通过 AWS ALB 从 Ruby 客户端请求它。 我们将其部署到 Fargate 上的 AWS ECS
当我尝试通过 ALB 发送请求时,出现以下错误
GRPC::Unavailable (14:failed to connect to all addresses; last error: INTERNAL:
ipv4:myip:50051: Trying to connect an http1.x server.
debug_error_string:{UNKNOWN:failed to connect to all addresses; last error: INTERNAL:
ipv4:myip:50051: Trying to connect an http1.x server {grpc_status:14,
created_time:"2023-08-04T19:03:50.762448829+09:00"}}):
[6edb224a-1729-49ae-aa15-d396e4e04366]
GRPC::Unavailable (14:failed to connect to all addresses; last error:
INTERNAL: ipv4:myip:50051:
Trying to connect an http1.x server.
debug_error_string:{UNKNOWN:failed to connect to all addresses;
last error: INTERNAL: ipv4:myip:50051:
Trying to connect an http1.x server
{grpc_status:14, created_time:"2023-08-04T19:03:50.762448829+09:00"}}):
我使用CDK构建Cloud,代码是这样的
const alb = new ApplicationLoadBalancer(scope, 'alb', {
internetFacing: true,
http2Enabled: true,
loadBalancerName: `alb`,
securityGroup: this.sgGroups[0],
vpcSubnets: {
subnets: this.subnets,
},
vpc: this.vpc,
})
const tg = new ApplicationTargetGroup(scope, 'a', {
protocol: ApplicationProtocol.HTTP,
protocolVersion: ApplicationProtocolVersion.GRPC,
port: 50051,
targetType: TargetType.IP,
vpc: this.vpc,
healthCheck: {
healthyGrpcCodes: '0-99',
port: '8080',
path: '/grpc.health.v1.Health/Check',
protocol: Protocol.HTTP,
},
})
new ApplicationListener(scope, 'b', {
loadBalancer: alb,
protocol: ApplicationProtocol.HTTPS,
port: 50051,
certificates: [
{
certificateArn: certificate.certificateArn,
},
],
defaultTargetGroups: [tg],
})
如果有人知道一些事情并让我知道,我会非常高兴。
我也有同样的问题。通过 ALB 直接起作用 - 不