-
Notifications
You must be signed in to change notification settings - Fork 645
Scaling on AWS ECS Fargate
Attention: We have migrated our documentation to our new platform, Ant Media Resources. Please follow this link for the latest and up-to-date documentation.
In this document, we’re going to explain how to setup a Scalable Ant Media Server Cluster in Amazon Web Services (AWS) ECS Fargate with Ant Media Server Container. If you are not familiar with Ant Media Server Cluster, you may check the introduction part of this to be familiar with the definitions and the components.
Please consider there will be two different "Cluster" word usage in this document. First one is Ant Media Server Scalable Cluster and we will use Ant Media Server Cluster to refer it. The other is the AWS ECS Cluster which is a logical grouping of tasks or services and we will use ECS Cluster to refer it.
-
Open AWS ECS Service
-
Navigate Clusters
-
Click Create Cluster
-
Select Networking Only Type then click next
-
Write ams-cluster as cluster name then click create
-
Open AWS ECS Service
-
Navigate Task Definitions
-
Click Create New Task Definition
-
Select Fargate then click next
-
Write mongo-task-definiton as Task Definition Name
-
Create a role with name of ecsTaskExecutionRole and attach AmazonECSTaskExecutionRolePolicy, AWSMarketplaceMeteringRegisterUsage policies
-
Select ecsTaskExecutionRole as Task Role
-
In Task size Part set Task Memory 2 GB and Task CPU 1 vCPU
-
Click Add Container
-
Write mongo-container into Container Name, Write mongo into Image then click Add
-
In Task Definition Page click Create
-
Open AWS ECS Service
-
Navigate Clusters
-
Selec ams-cluster
-
Navigate Tasks tab
-
Click Run New Task
-
Select Fargate as Launch type
-
Select mongo-task-definition as Task Definition
-
In VPC and security groups Part
-
Select public VPC as Cluster VPC
-
Select at least one subnet from VPC
-
Edit Security Group as enabling 27017 TCP port
-
It should be like
-
Click Run Task
-
When task starts to work, copy the Private IP of Mongo Container
-
Open AWS ECS Service
-
Navigate Task Definitions
-
Click Create New Task Definition
-
Select Fargate then click next
-
Write ams-node-task-definiton as Task Definition Name
-
Select ecsTaskExecutionRole as Task Role
-
In Task size Part set Task Memory 8 GB and Task CPU 4 vCPU
-
Click Add Container
-
Write
- ams-container into Container Name,
- 709825985650.dkr.ecr.us-east-1.amazonaws.com/ant-media/ant-media-server-ee:2.4.0.2 into Image
- add 5080 TCP into Port Mapping
- /usr/local/antmedia/start.sh,-m,cluster,-h, into Entry point
then click Add
-
In Task Definition Page click Create
-
Create an origin-target-group from EC2 Load Balancing
-
Set Target Type IP, Port 5080, VPC the public VPC
-
Create an edge-target-group from EC2 Load Balancing
-
Set Target Type IP, Port 5080, VPC the public VPC
-
Create an Application Load Balancer
-
Add listeners for HTTP(S) 80, 5080, 443, 5443
-
Add Sertificate to ALB
-
Add Security group that allows the ports 80, 5080, 443, 5443
-
Configure routing using the previously created origin-target-group. Note that we will edit the routing after creation.
-
When it is created edit Listeners as forwarding 80, 443 to origin-target-group, 5080, 5443 to edge-target-group
-
Open AWS ECS Service
-
Navigate Clusters
-
Selec ams-cluster
-
Navigate Services tab
-
Click Create
-
Select Fargate as Launch type
-
Select ams-node-task-definition as Task Definition
-
Write origin-service as Service Name
-
Click Next
-
In Configure network Page
- Select public VPC as Cluster VPC
- Select at least one subnet from VPC
- Edit Security Group for Ant MediaServer
- Select Application LoadBalancer
- Add 80/443 Listener Ports and select origin-target-group
-
In Auto Scaling Page
-
Define min, max, desired number of containers
-
Add a CPU policy for scale in
- Follow Step 6 by changing all origin to edge and 80/443 to 5080/5443
- Access the login page http://Load-Balancer-URL:5080
- Login to access to the dashboard
- Introduction
- Quick Start
- Installation
- Publishing Live Streams
- Playing Live Streams
- Conference Call
- Peer to Peer Call
- Adaptive Bitrate(Multi-Bitrate) Streaming
- Data Channel
- Video on Demand Streaming
- Simulcasting to Social Media Channels
- Clustering & Scaling
- Monitor Ant Media Servers with Apache Kafka and Grafana
- WebRTC SDKs
- Security
- Integration with your Project
- Advanced
- WebRTC Load Testing
- TURN Servers
- AWS Wavelength Deployment
- Multi-Tenancy Support
- Monitor Ant Media Server with Datadog
- Clustering in Alibaba
- Playlist
- Kubernetes
- Time based One Time Password
- Kubernetes Autoscaling
- Kubernetes Ingress
- How to Install Ant Media Server on EKS
- Release Tests
- Spaceport Volumetric Video
- WebRTC Viewers Info
- Webhook Authentication for Publishing Streams
- Recording Streams
- How to Update Ant Media Server with Cloudformation
- How to Install Ant Media Server on GKE
- Ant Media Server on Docker Swarm
- Developer Quick Start
- Recording HLS, MP4 and how to recover
- Re-streaming update
- Git Branching
- UML Diagrams