Skip to content

How to Setup Ant Media Server Clustering on Azure

muratugureminoglu edited this page Nov 1, 2020 · 42 revisions

In this guide, I will explain how to setup Ant Media Server Clustering on Azure. When your load is high, one server instance is not enough for you and you can handle that load with a clustering solution.

For streaming applications, you will need a clustering solution when you have high numbers of publishers and viewers. Especially when you require ultra-low latency and adaptive bitrate because they need more processing power. Ultra-low latency is achieved by WebRTC and it is a CPU intensive protocol. Adaptive bitrating is downgrading video quality in bad networks if needed. It is also CPU intensive because there is video conversion. Luckily, Ant Media Server Enterprise Edition supports clustering, so that you can handle the high load in your streaming applications.

Requirements: To set up media server, Having an Azure account and a ready AntMedia Server Image are needed.

The architecture of the cluster setup could be found here. Introduction to clustering with AntMedia Server could be found here.

Step 1: Create a Resource Group

Image

Image

Image

Step 2: Create a Virtual Network

We need to create a virtual network named antmedia-cluster-virtual-network, and then we will add gateway-subnet, origin-subnet and edge-subnet as described in this doc.

Click Create a Resource in the portal which is on the upper left. Enter Virtual network in the Search the Marketplace box at the top of the New pane that appears. Click Virtual network when it appears in the search results.

Image

Select Classic in the Select a deployment model box in the Virtual Network pane that appears, then click Create.

Image

Daha once olusturdugumuz resource grubu secip, name alanina antmedia-clustur-virtual-network yazip "Next: IP Address" butonuna tiklayin.

Image

Add subnet butonuna tiklayip antmedia-origin-subnet, antmedia-edge-subnet ve antmedia-gw-subnet lerini asagidaki sekildeki gibi olusturun.

Image

Olusturdugunuz subnet asagidaki gibi gozukecektir. Her sey tamamsa "Review + create" butonuna tiklayip Virtual Networkunuzu olusturun.

Image

Create butonuna tiklanayarak islem tamamlanir.

Image

Step 3: Create a MongoDB Virtual Machine

Click Virtual Machines on the left bar and then click +Add:

Image

Enter the following values and click next:

Image

Enter the following values and click next:

Image

Virtual Network kismindan olusturdugumuz Virtual Networku secin, Nic network security Group 'dan Advanced 'i secin ve Create New e tiklayin.

Image

Acilan pencerede Add an inbound Rule tiklayin ve asagidaki gibi inbound security rule ekleyin.

Image

Enter the following values and click next:

Image

Custom data alanina asagidaki satirlari ekleyin ve "Review + Create" butonuna tiklayip MongoDB instnacesini olusturun.

#!/bin/bash
wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu `lsb_release -cs`/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
sudo apt-get update
sudo apt-get install -y mongodb-org
sed -i 's/bindIp:.*/bindIp: 0.0.0.0/g' /etc/mongod.conf
systemctl restart mongod

Image

Image

Step 4: Create Application Gateway

Click Create a Resource in the portal which is on the upper left. Enter Application Gateway in the Search the Marketplace box at the top of the New pane that appears. Click Application Gateway when it appears in the search results.

Image

Select Classic in the Select a deployment model box in the Application Gateway pane that appears, then click Create.

Image

Resource Group, Application Gateway Name, Region ve Virtual Network ayarlarini asagidaki gibi giriniz ve "Next: Frontends" e tiklayin.

Image

Add New butonuna tiklayip asagidaki gibi girin ve "Next: Backends" 'e tiklayin.

Image

Add a Backend pool 'a tiklayip ekram goruntusundeki gibi hem origin hem de Edge icin poollar olusturun ve "Next: Configuration" 'a tiklayin.

Image

Add a routing rule 'e atiklayin.

Image

Ekran goruntundeki gibi alanlari doldurup "Backend targets" 'i tiklayin.

Image

Backend target "Edge" poolunu secin ve HTTP settings icon Add new 'e tiklayin.

Image

Asagidaki gibi doldurun. Bu ayar hem origin hem de origin icin olacaktir.

Image

Ayarlariniz asagidaki gibiyse HTTP istekler icin Edge yapilandirilmasi bitmistir.

Image

Tekrar "Add a routing rule" 'e tiklayip Origin icin HTTP ayarlarini yapalim. Asagidaki gibi ayarlari yapip "Backend target" tiklayin.

Image

Backend target olarak Origin poolunu secin ve HTTP settings olarakta onceden olusturdugumuz "BackendHttpSettings" i secin.

Image

Simdi sirada Origin icin HTTPS isteklerini yonlendirmeye geldi. Bunun icin asagidaki gibi ayarlari yapin. cluster.antmedia.io.pfx sertifikasi icin bu linki kullanabilirsiniz.

Image

Backend target olarak Origin ve HTTP Settings olarak "BackendHttpSetting" secin.

Image

Ayni sekilde Edge icin 5443 icin yapilandirmayi asagidaki gibi yapin.

Image

Backend target olarak Edge ve HTTP Settings olarak "BackendHttpSetting" secin.

Image

Tam olarak application-gateway ayarlari asagidaki gibi gozukecektir. Her sey yolundaysa "Next:Tags" tiklayin.

Image

Son olarak "Create" basarak kurulumu tamamlayin.

Image

Step 4: Create Edge/Origin Scale Sets

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

Image

User Guide

Reference

Troubleshooting

Draft

Proposals

Clone this wiki locally