Skip to content

OpenVidu High Availability: AWS Administration#

Warning

While in BETA this section is subject to changes. We are working to simplify the configuration and administration of OpenVidu High Availability.

The deployment of OpenVidu High Availability on AWS is automated using AWS CloudFormation, with 4 EC2 Instances as Master Nodes and any number of Media Nodes managed within an Auto Scaling Group. The Auto Scaling Group of Media Nodes is configured to scale based on the target average CPU utilization.

Internally, the AWS deployment mirrors the on-premises setup, allowing you to follow the same administration and configuration guidelines provided in the On Premises High Availability documentation. However, there are specific considerations unique to the AWS environment that are worth taking into account.

Cluster Shutdown and Startup#

You can start and stop the OpenVidu High Availability cluster at any time. The following sections detail the procedures.

To shut down the cluster, you need to stop the Media Nodes first and then stop the Master Nodes; this way, any ongoing session will not be interrupted.

  1. Navigate to the CloudFormation Dashboard on AWS.
  2. Select the CloudFormation Stack that you used to deploy OpenVidu High Availability.
  3. In the "Resources" tab, locate the resource with the logical ID: OpenViduMediaNodeASG, and click on it to go to the Auto Scaling Group Dashboard with the Auto Scaling Group of the Media Nodes selected.
    Select Auto Scaling Group
  4. Click on "Actions > Edit".
    Edit Auto Scaling Group
  5. Set the "Desired capacity", "Min desired capacity", and "Max desired capacity" to 0, and click on "Update".
    Set Desired Capacity to 0
  6. Wait until the "Instance Management" tab shows that there are no instances in the Auto Scaling Group.

    Instance Management

    Warning

    It may happen that some instances are still in the "Terminating:Wait" lifecycle state after setting the desired capacity to 0. This is because the Auto Scaling Group waits for the instances to finish processing any ongoing room, ingress, or egress operations before terminating them. This can take a few minutes. If you want to force the termination of the instances, you can manually terminate them from the EC2 Dashboard.

  7. Navigate to the EC2 Dashboard on AWS.

  8. Stop all the Master Nodes instances by selecting them and clicking on "Stop instance".
    Stop Master Nodes
  9. Wait until the instances are stopped.

To start the cluster, we recommend starting the Master Node first and then the Media Nodes.

  1. Navigate to the EC2 Dashboard on AWS.
  2. Start all the Master Nodes instances by selecting them and clicking on "Start instance".
    Start Master Nodes
  3. Wait until the instances are running.
  4. Go to the CloudFormation Dashboard on AWS.
  5. Select the CloudFormation Stack that you used to deploy OpenVidu High Availability.
  6. Locate the resource with the logical ID: OpenViduMasterNodeASG. Click on it to go to the Auto Scaling Group Dashboard with the Auto Scaling Group of the Master Nodes selected.
    Select CloudFormation Stack
  7. Click on "Actions > Edit".
    Edit Auto Scaling Group
  8. Set the "Desired capacity", "Min desired capacity", and "Max desired capacity" to the desired number of Media Nodes, and click on "Update". For the Master Nodes auto scaling group, the number of instances must be 4.
    Set Desired Capacity to 2
  9. Wait until the "Instance Management" tab shows that there are the desired number of instances in the Auto Scaling Group.
    Instance Management
  10. Go back to the CloudFormation Stack and locate the resource with the logical ID: OpenViduMediaNodeASG. Click on it to go to the Auto Scaling Group Dashboard with the Auto Scaling Group of the Media Nodes selected.
    Select Auto Scaling Group
  11. Click on "Actions > Edit".
    Edit Auto Scaling Group
  12. Set the "Desired capacity", "Min desired capacity", and "Max desired capacity" to the desired number of Media Nodes, and click on "Update". In this example, we set the desired capacity to 2.
    Set Desired Capacity to 2
  13. Wait until the "Instance Management" tab shows that there are the desired number of instances in the Auto Scaling Group.
    Instance Management

Change the instance type#

It is possible to change the instance type of both the Master Node and the Media Nodes. The following section details the procedures.

Warning

This procedure requires downtime, as it involves stopping all the Master Nodes and starting them again with the new instance type.

  1. Navigate to the EC2 Dashboard on AWS.
  2. Stop all the Master Nodes instances by selecting them and clicking on "Stop instance".
    Stop Master Nodes
  3. Wait until the instances are stopped.
  4. For each node you want to change the instance type, select it, and click on "Instance settings > Change instance type".
    Change instance type
  5. Select the new instance type and click on "Change".
  6. Repeat the process for all the Master Nodes.
  1. Go to the CloudFormation Dashboard on AWS.
  2. Select the CloudFormation Stack that you used to deploy OpenVidu High Availability.
  3. Locate the resource with the logical ID: OpenViduMediaNodeLaunchTemplate. Click on it to go to the Launch Template Dashboard with the Launch Template of the Media Nodes selected.
    Select Launch Template
  4. Click on "Actions > Modify template (Create new version)".
    Edit Launch Template
  5. In the "Instance type" section, select the new instance type and click on "Create template version".
    Change instance type
  6. Go to the CloudFormation Stack and locate the resource with the logical ID: OpenViduMediaNodeASG. Click on it to go to the Auto Scaling Group Dashboard with the Auto Scaling Group of the Media Nodes selected.
    Select Auto Scaling Group
  7. Click on "Actions > Edit".
    Edit Auto Scaling Group
  8. In the Launch Template section, select the new version of the launch template we just created at step 5 which is the highest version number.

    Then, click on "Update".

    Info

    By configuring "Latest" as the launch template version, you no longer need to update the Auto Scaling Group every time you modify the launch template. The Auto Scaling Group will automatically use the latest version of the launch template.

    Change launch template version

  9. Terminate the old instances manually from the EC2 Dashboard if you want to force the termination of the instances. New instances will be launched with the new instance type.

    Info

    If you want to avoid downtime, you can wait until the Auto Scaling Group replaces the old instances with the new ones. But you will need to increase the desired capacity to force the replacement of the instances and then decrease it to the desired number of instances.

Media Nodes Autoscaling Configuration#

To configure the Auto Scaling settings for the Media Nodes, follow the steps outlined below. This configuration allows you to set the parameters that control how the Auto Scaling Group will scale based on the target average CPU utilization.

  1. Navigate to the CloudFormation Dashboard on AWS.
  2. Select the CloudFormation Stack that you used to deploy OpenVidu High Availability.
  3. In the "Resources" tab, locate the resource with the logical ID: OpenViduMediaNodeASG and click on it to go to the Auto Scaling Group Dashboard.
    Select Auto Scaling Group
  4. Click on "Actions > Edit".
    Edit Auto Scaling Group
  5. To configure scaling policies, navigate to the "Automatic scaling" tab within the Auto Scaling Group Dashboard, select the unique "Target tracking scaling" autoscaling policy, and click on "Actions > Edit".
    Scaling Policies
  6. It will open a panel where you can configure multiple parameters. In this example, we set the target average CPU utilization to 30%. Then, click on "Update".

    Edit Scaling Policies

    Info

    OpenVidu High Availability is by default configured with a "Target tracking scaling" policy that scales based on the target average CPU utilization, however, you can configure different autoscaling policies according to your needs. For more information on the various types of autoscaling policies and how to implement them, refer to the AWS Auto Scaling documentation.

Fixed Number of Media Nodes#

If you need to maintain a fixed number of Media Nodes instead of allowing the Auto Scaling Group to dynamically adjust based on CPU utilization, you can configure the desired capacity settings accordingly. Follow the steps below to set a fixed number of Media Nodes:

  1. Navigate to the CloudFormation Dashboard on AWS.
  2. Select the CloudFormation Stack that you used to deploy OpenVidu High Availability.
  3. In the "Resources" tab, locate the resource with the logical ID: OpenViduMediaNodeASG and click on it to go to the Auto Scaling Group Dashboard.
    Select Auto Scaling Group
  4. Click on "Actions > Edit".
    Edit Auto Scaling Group
  5. Set the "Desired capacity", "Min desired capacity", and "Max desired capacity" to the fixed number of Media Nodes you require, and click on "Update". In this example, we set the desired capacity to 2.
    Set Fixed Desired Capacity
  6. Wait until the "Instance Management" tab shows that the Auto Scaling Group has the fixed number of instances running.
    Instance Management

Administration and Configuration#

For administration, you can follow the instructions from the On Premises High Availability Administration section.

Regarding the configuration, in AWS it is managed similarly to an on-premises deployment. For detailed instructions, please refer to the Changing Configuration section. Additionally, the How to Guides offer multiple resources to assist with specific configuration changes.

In addition to these, an AWS deployment provides the capability to manage global configurations via the AWS Console using AWS Secrets created during the deployment. To manage configurations this way, follow these steps:

  1. Navigate to the CloudFormation Dashboard on AWS.
  2. Select the CloudFormation Stack that you used to deploy OpenVidu High Availability.
  3. In the "Outputs" tab, click the Link at "ServicesAndCredentials". This will open the AWS Secrets Manager which contains all the configurations of the OpenVidu High Availability Deployment.
    Select Secrets Manager
  4. Click on the "Retrieve secret value" button to get the JSON with all the information.
    Retrieve Secret Value
  5. Modify the parameter you want to change and click on "Save". The changes will be applied to the OpenVidu High Availability deployment.
  6. Go to the EC2 Console and click on "Reboot instance" in the Master Node instance to apply the changes.
    Reboot Instance

The changes will be applied automatically in all the Nodes of the OpenVidu High Availability deployment.