Try Live Demo

Unlock the full potential of your streaming platform on Oracle Cloud with our comprehensive guide on how to scale Ant Media Server on the Oracle Cloud Platform in order to create a streaming service at scale.

As the demand for seamless, high-quality live streaming continues to grow, the ability to scale efficiently in real time becomes paramount.

In this detailed post, we will explore the nuances of expanding your Ant Media Server infrastructure within the Oracle Cloud, guaranteeing peak performance and an outstanding viewing experience for your audience.

Why should you set up your streaming service using Ant Media Server on Oracle Cloud?

Ant Media Server can be deployed on-premise or on cloud. One of the supported cloud providers is Oracle Cloud. Read more other providers and Ant Media Server scaling in general on our documentation.

  • Ant Media Server is the first and only live streaming engine on Oracle Cloud.
  • Oracle has a different pricing model from other cloud marketplaces. Generally cloud servers have prices structured like 2/4/8/16/32 CPU cores. Oracle has a pricing structure per CPU core so you can use it with 3 cores or 5 cores, etc.
  • Oracle has a scaling system in which the same CPU cores can be increased automatically as the load increases without having to launch new nodes.

Prerequisite or what you should have when you start

  • You should have an Oracle Cloud account.
  • You should have a tenancy configured for your Oracle Cloud account. When you create an account, it automatically creates a tenancy as part of the account creation process. Just make sure you actually have it.

Step 1: Create a Compartment

Compartments on the Oracle Cloud are like projects. So as the first step, we’ll create a new project by creating a compartment and then we will use the same compartment for creating all the resources.

  • Check for the three horizontal lines on the top left of the screen next to the Oracle Cloud logo
compartment-on-oracle-cloud-ant-media
Go to the Setting on Oracle Cloud dashboard
  • Go to the Identity & Security section and then to Compartments and finally click Create Compartment.
Compartment tutorial ant media server
Where to find Compartments on Oracle Cloud settings?
  • For this demo, I have created a compartment named auto-scaling. And throughout this implementation, we’ll be using the same compartment.

Step 2: Create a Virtual Cloud Network (VCN)

  • Go to Networking and then to Virtual Cloud Networks.
Virtual-Cloud-Networks-on-oracle-ant-media
Where to find Virtual Cloud Networks on Oracle Cloud settings?
  • Click on Create VCN to create Virtual Cloud Networks and enter a CIDR range.
Create-Virtual-Cloud-Network-on-oracle-ant-media-server
How to set up Virtual Cloud Networks in your Compartment on Oracle?
  • In the VCN, create a Subnet.
subnet-on-Virtual-Cloud-Network-oracle-ant-media
Create a subnet in Virtual Cloud Networks on Oracle Cloud for your live streaming service
  • In the Subnet, you need to add a Security List with the required ports.
security-group-on-subnet-on-VCN-oracle-ant-media
Ingress Rules on Oracle Cloud dashboard for your AMS project
  • Create an Internet gateway and a Routing Table and attach it to the IG.
route-rules-on-VCN-oracle-ant-media
Route Rules on Oracle Cloud dashboard for your real-time broadcasting service

Step 3: Install the MongoDB server

  • To create an instance on Oracle Cloud, Go to Compute and then to Instances.
Instances on Oracle Cloud setting for Ant Media Server
Instances settings section on Oracle Cloud dashboard
  • Click on Create Instance and give your MongoDB instance a name.
  • Use the same compartment and choose the Availability domain in which you want to launch the MongoDB database.
  • Under Image and Shape, for the image click on Change Image and select Ubuntu and then choose Ubuntu 20.04 and click Select Image.
Install the MongoDB server on oracle cloud using ant media server
Install the MongoDB server for your Ant Media Server on Oracle
  • Change the shape as desired and then click Select shape.
set up shape while installing MongoDB server on oracle cloud using ant media server
Configure MongoDB server for your Ant Media Server on Oracle cloud marketplace
  • As we did in step 2, we need to create a VCN for the MongoDB as well and select the same network and subnet for the MongoDB.
create VCN for the MongoDB on oracle cloud using ant media server
Create aVCN for the MongoDB server on Oracle cloud dashboard for your Ant Media Server product.
  • Create the SSH details by either downloading a new private key or by uploading the public key as needed.
  • Click Create.
  • Once the instance is launched, ssh to the MongoDB instance and install SSL:
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_mongodb.sh && chmod +x install_mongodb.sh
sudo ./install_mongodb.sh --auto-create
  • After the installation is successful, please note down the MongoDB username and password.

Step 4: Install Ant Media Server Enterprise Edition

  • Again, go to Compute and then to Instances on Oracle Cloud dashboard.
  • Click on Create Instance and give the instance a name.
  • Use the same compartment that you created in Step 1 and choose an Availability domain.
  • Under Image and Shape, for Image click on Change Image and then on Marketplace, and then search and choose Ant Media Server. After checking the agreement box, click on Select Image.
Install Ant Media Server Enterprise license on oracle cloud
Install Ant Media Server Enterprise Edition on Oracle Cloud Marketplace
  • Change the shape and set as desired. It is recommended to use at least a 4-core Server with 8GB RAM for running the AMS enterprise edition efficiently.
set up your ant media server on oracle cloud dashboard
Configure Ant Media Server Enterprise license on Oracle Cloud
  • Choose the VCN that you created in Step 2.
  • Create the SSH credentials as needed.
  • Under Advanced Options, go to the initialization script and click on the cloud-init script, copy the text below, change the MongoDB IP Address, username, and passwords in the script according to your MongoDB credentials, and paste it.
implement cloud-init script using ant media server on on oracle cloud marketplace
Add the cloud-init script during Ant Media Server set up on Oracle Cloud
#!/bin/bash
cd /usr/local/antmedia
./change_server_mode.sh cluster 10.128.0.5 username password
  • Check if everything is OK and Click Create.

Step 5: Create Instance Configuration

  • Once the instance is launched and running, go to actions and then click on Create Instance Configuration.
Instance Configuration setting on oracle cloud
Create Instance Configuration on Oracle Cloud for your Ant Media Server project
  • Use the same compartment, give it a name, and click Create Instance Configuration.
  • Once the Instance configuration is created, we can create an Instance Pool.
  • We will create two Instance pools, one each for the Origin and Edge Group but before that, we need to create Load Balancers.

Step 6: Create the Load Balancers

  • Under Networking, you can locate Load Balancer.
Load Balancer tutorial on oracle cloud
Create Load Balancer on Oracle Cloud for your Ant Media Server project
  • Here we’ll create two Load Balancers, one for the Origin group and the second one for the Edge group.

Origin Load Balancer

  • Under Load Balancer, click on “Create Load Balancer”
Load Balancer set up using Ant Media Server on Oracle Cloud
Open Load Balancers settings on Oracle Cloud dashboard
  • Give your Load Balancer a name, the visibility type should be public, and the IP address should be Ephemeral IP address.
Load Balancer guide using Ant Media Server on oracle cloud
Set up Load Balancer on Oracle Cloud for your Ant Media Server project
  • Define the bandwidth and for Networking, under the Virtual Cloud network, choose the related compartment and the subnet.
load balancer tutorial using ant media server on oracle cloud
Configure Load Balancer on Oracle Cloud for your Ant Media Server project
  • Under Configure listener, give the listener a name, the traffic type should be HTTPS and the port is 443 for the Origin group.
Configure listener using ant media server on oracle cloud
Configure listener during Load Balancer setup on Oracle Cloud for your Ant Media Server project
  • Now in order to enable the SSL, choose “Load balancer managed certificate” under “Certificate resource”, then paste the SSL certificate and the private key.
add ssl certificate ant media server on oracle cloud
Add SSL certificate during Load Balancer setup on Oracle Cloud for your Ant Media Server project
  • Then you can enable logging as needed.
logging for load balancer using ant media server on oracle cloud
Set up proper logging during Load Balancer setup on Oracle Cloud for your Ant Media Server project

Edge Load Balancer

Similarly, we can create the Load Balancer for the Edge group of nodes as well. The only change is under “Configure listener” use port 5443

Step 7: Create Origin Instance Pool

  • Go to Compute > Instance Configuration > Create Instance Pool
  • Add Basic details and click Next.
Origin Instance Pool using ant media server on oracle cloud
Add basic info on the first step of Creating instance pool on Oracle Cloud
  • Configure Pool Placement.
Configure Pool Placement using ant media server on oracle cloud
Set up your pool placement properly on Oracle Cloud
  • Attach the Load Balancer.
attach load balancer using ant media server on oracle cloud
Add Load Balancer to your instance pool on Oracle Cloud
  • Review and click Create.

Step 8: Create Autoscaling Configurations for Origin

  • After the instance pool is created, click on More Actions and Autoscaling Configurations.
set up auto scaling for streaming services on oracle cloud
Create autoscaling configuration on Oracle Cloud dashboard
  • Add Basic details.
  • Under Policy, select Metric-Based autoscaling.
  • Under Performance metric, choose CPU utilization and set scale out to greater than 65 percent and add one.
  • Set the Scale in, for less than 40 percent and remove one.
  • Under Scaling limits, It can be set as needed.
autoscaling policy on oracle cloud for ant media server
Configure autoscaling policy on Oracle cloud for your Ant Media Server project
  • Click Next and then Review and Create.

Step 9: Set up Edge Instance Pool and Autoscaling Configurations

We can follow steps 7 and 8 to create the Instance pool for the Edge group and then the Autoscaling configurations.

Step 10: Access the Ant Media Server Web Panel

Once the setup is complete, you can access the Ant Media server cluster web panel by using the Load Balancer URLs.

Categories: Tutorial

Mohit Dubey

Mohit is your go-to Technical Support Engineer at Ant Media Server with the aim to make the streaming seamless and accessible, proficient in navigating cloud platforms. He likes to contribute towards product installation/deployment, testing, documentation, troubleshooting, and customer support, etc. Also, well-versed with AWS Streaming Wizard and the ins and outs of Ant Media Server.

chatsimple
Warning: Undefined array key "promocode" in /home/mirror.antmedia.io/public_html/wp-content/themes/hestia-child/footer.php on line 70