OpenVidu High Availability administration: DigitalOcean#
DigitalOcean
The OpenVidu High Availability deployment on DigitalOcean is fully automated using the Terraform CLI. It provisions 4 Droplets for the Master Nodes, while Media Nodes are managed through a Fixed Droplet Autoscale Pool .
Internally, the DigitalOcean High Availability deployment mirrors the On Premises High Availability deployment, allowing you to follow the same administration and configuration guidelines of the On Premises High Availability documentation. However, there are specific considerations unique to the DigitalOcean environment that are worth keeping in mind:
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 and then stop the Master Nodes.
- Navigate to the DigitalOcean Autoscale Pools Web .
- Click into the Droplet Autoscale Pool resource called
<STACK_NAME>-media-node-pool, go to "Settings" and click on "Edit" in the Autoscale Pool Configuration.
- Drop down the Number of Droplets to 0, click "Save" and wait for it to apply the changes.
- After confirming that all Media Node instances are terminated, in the "Droplets" tab select the droplet called
<STACK_NAME>-master-node-1. Click on it to go to the Master Node 1 instance, then click "Power" and then "Turn off" the droplet.
- Repeat step 4 for all Master Nodes.
To start the cluster, start the Master Nodes first and then the Media Nodes.
- Navigate to the DigitalOcean Droplet Web .
- Select the droplet named
<STACK_NAME>-master-node-1, then go to "Power" and then "Turn on" the droplet.
- Wait until the instance is running.
- Repeat steps 2 and 3 until all Master Nodes are up and running.
- Go back to the "Autoscale Pools" tab, then click the Droplet Autoscale Pool resource called
<STACK_NAME>-media-node-pool, go to "Settings" and click on "Edit" in the Autoscale Pool Configuration.
- Change the number to the number of media nodes you want and click "Save", then wait for the change to be applied.
Change the instance size#
It is possible to change the instance size of both the Master Node and the Media Nodes. However, since the Media Nodes are part of an Autoscale Pool, the process differs. The following section details the procedures:
Warning
This procedure requires downtime, as it involves stopping the Master Node.
-
Info
You can stop only the Master Node droplet to change its droplet size, but it is recommended to stop the whole cluster to avoid any issues.
-
Go to the DigitalOcean Droplet Web and locate the resource with the name
<STACK_NAME>-master-node-1and click on it. - Click on "Upsize" and select the Droplet size you desire and click on "Resize"
- Repeat step 3 on every Master Node.
- Start the cluster.
Warning
This will delete the media nodes without the graceful delete option. You can stop them gracefully by manually running the /usr/local/bin/graceful_shutdown.sh script and waiting for it to finish. You have to do it in all the media nodes because the autoscale pool will delete all media nodes and create new ones.
- Navigate to the DigitalOcean Autoscale Pools Web .
- Click into the Droplet Autoscale Pool resource called
<STACK_NAME>-media-node-pool, go to "Settings" and click on "Edit" in the Droplet Configuration.
- Scroll down to the Choose a Droplet Plan section and change the size to the one you prefer, then click on "Edit Autoscale Pool" and wait for the changes to apply.
Media Nodes Autoscaling Configuration#
You can modify the autoscaling configuration of the Media Nodes via terraform.tfvars file and terraform apply:
-
Go to the
terraform.tfvarsfile and change the config related to autoscaling, such as:- scaleTargetCPU
- minNumberOfMediaNodes
- maxNumberOfMediaNodes
-
Open a terminal and write the following command once you've changed the value/s.
- Say yes to the proposed change that Terraform is suggesting (the changes are the autoscale function redeploying with the new values), and your changes will be applied.
Change Fixed Number of Media Nodes#
You can change the fixed number of Media Nodes in case you put a number of fixed Media Nodes by following these steps:
- Go to the DigitalOcean Autoscale Pools Web .
- Click into the Droplet Autoscale Pool resource called
<STACK_NAME>-media-node-pool, go to "Settings" and click on "Edit" in the Autoscale Pool Configuration.
- Change the number to the desired value and click "Save", then wait for the Autoscale Pool to apply the changes.
Warning
This will delete the media nodes if you have set them to less than the number of media nodes that existed. You can stop them gracefully by manually running the /usr/local/bin/graceful_shutdown.sh script and waiting for it to finish. You have to do it in all the media nodes because the autoscale pool deletes all and creates new ones.
Activate Scale In when Fixed Number of Media Nodes#
You can activate or deactivate the scale in when you decide you need autoscale option activated or not.
-
Go to the
terraform.tfvarsfile and change the config related to autoscaling, such as:- fixedNumberOfMediaNodes needs to be set to 0.
- scaleTargetCPU if you don't want the default.
- minNumberOfMediaNodes if you don't want the default.
- maxNumberOfMediaNodes if you don't want the default.
-
Open a terminal and write the following command once you've changed the value/s.
- Say yes to the proposed change that Terraform is suggesting (the changes are destroying the fixed number of media nodes and deploying the scale-in function), and your changes will be applied.
-
Go to the
terraform.tfvarsfile and change the config related to autoscaling, such as:- fixedNumberOfMediaNodes needs to be set to your desired value.
-
Open a terminal and write the following command once you've changed the value/s.
- Say yes to the proposed change that Terraform is suggesting (the changes are destroying the scale-in function and all the media nodes and deploying the fixed number of media nodes pool), and your changes will be applied.
Administration and configuration#
Regarding the administration of your deployment, you can follow the instructions in section On Premises High Availability Administration.
Regarding the configuration of your deployment, you can follow the instructions in section Changing Configuration. Additionally, the How to Guides offer multiple resources to assist with specific configuration changes.
In addition to these, a DigitalOcean deployment provides the capability to manage global configurations by downloading secrets.env file of the bucket and changing it, then upload it again. Here are the detailed steps:
- Navigate to the DigitalOcean Spaces Object Storage and click on the cluster data bucket that you are using for the deployment.
- Download the
secrets.envfile that is in the bucket.
- Open it and edit the credential values of your choice.
- Upload the edited
secrets.envto the bucket, select private file and replace it.
- Restart Master Node 1 by shutting it down and then starting it again. Changes will be applied automatically in all the nodes of your OpenVidu High Availability deployment.
Backup and Restore#
Review the Backup and restore OpenVidu deployments guide for recommended backup workflows.