0

I have read the post about how to expose multiple ports in AWS ECS (fargate) load balancer. And I have opened port 80 (HTTP) and 1935 (RTMP) in load balancer and they are also exposed in docker and target definition.

When I describe the service, I could see two target group there.

{
    "services": [
        {
            "serviceArn": "arn:aws:ecs:ap-southeast-2:549825492835:service/race365/race365-ecs-service",
            "serviceName": "race365-ecs-service",
            "clusterArn": "arn:aws:ecs:ap-southeast-2:549825492735:cluster/CLUSTER-NAME",
            "loadBalancers": [
                {
                    "targetGroupArn": "arn:aws:elasticloadbalancing:ap-southeast-2:549825492835:targetgroup/au-http-elb-target-group/0380b91961061a95",
                    "containerName": "website",
                    "containerPort": 80
                },
                {
                    "targetGroupArn": "arn:aws:elasticloadbalancing:ap-southeast-2:549825492835:targetgroup/au-rtmp-elb-target-group/a238b344a3edc138",
                    "containerName": "website",
                    "containerPort": 1935
                }
            ],
            "serviceRegistries": [],
            "status": "ACTIVE",
            "desiredCount": 1,

But the cluster service deployment failed. I checked the target group I created (the rtmp one), and I found that the healthy check also failed.

In (rtmp) target group health check setting page, the protocol is http/https, no rtmp. And I created that target group is for my nginx stream.

How to make rtmp working under AWS ECS (fargate) load balancer?

Please help. Any idea is appreciated.

Thanks.

Charles
  • 675
  • 3
  • 12
  • 21
  • BTW, when I ran `nc -zvw10 AWS-DNS-NAME.com 1935`, I could see **Connection to xxx.com 1935 port [tcp/*] succeeded!** message. And when I ran `ffmpeg` command, I got **Cannot read RTMP handshake response** error. When I ran `aws ecs execute-command` to access the container and ran the same ffmpeg command in container, nginx works and I could get streamed video played in website. That is all I got for now, – Charles Apr 20 '23 at 07:22
  • When you said you "read the post", linking to whatever post you read would be helpful so we understand where you are coming from. Please update your question to clarify if you are using an Application Load Balancer or a Network Load Balancer. Also please show your security group settings. – Mark B Apr 20 '23 at 12:15

0 Answers0