Upgrading Red5 Pro for Autoscaling Nodes

The easiest way to create a new disk image for autoscaling is per the following:

1. Create a new server instance using the image/AMI that you are currently using for autoscaling

Download the latest Red5 Pro Server distribution from https://account.red5pro.com/download to your local machine.

Create a new server instance for Google

  • From Compute Engine, VM instances, choose Create an Instance in your default zone.
  • In the Boot disk section, click on Change. Select the Custom images tab, and choose your Red5 Pro server image.

Copy the Red5 Pro Server zip file to this instance. SSH into your instance and stop the Red5 Pro service (/etc/init.d/red5pro stop). You may need to install new libraries since the last server release, so check the Linux Install instructions and run through software dependencies. Per "How to Upgrade Red5 Pro Server," Rename your existing red5pro folder to bak.red5pro (sudo mv red5pro bak.red5pro). Copy and unzip the new distribution into the same directory where the original red5pro folder was (e.g. /usr/local/). After it is unzipped, rename that directory to red5pro (sudo mv red5pro-server-* red5pro). Copy the following files from the old build to the new: conf/autoscale.xml, webapps/red5-default.xml, and LICENSE.KEY.

Start the server (/etc/init.d/red5pro start) and hit the IP address at port 5080 to make sure there are no missing dependencies and the server starts correctly.

Create a new server instance for AWS

  • Navigate to the EC2 Dashboard
  • From left-hand navigation, under INSTANCES, click on Instances, then Launch Instance
  • Step 1: Choose My AMIs - Select the AMI that corresponds to your current autoscaling node configuration.
  • Step 2: Choose an Instance Type - Select any machine type (free-tier is fine). Click on Next: Configure Instance Details.
  • Step 3: Configure Instance Details - Network: choose the VPC that your created for autoscaling in that region. Ensure that “Auto-assign Public IP” is set to Enable; accept all other defaults.
  • Click on Next: Add storage; click on Next: Tag Instance; click on Next: Configure Security Group
  • Step 6: Configure Security Group - choose “Select an existing security group” and choose the group that you created for Red5 Pro autoscaling.
  • Click Review and Launch
  • Click Launch
  • In the final step when prompted, Choose an existing key pair, and select the public key that you created for autoscaling.

Copy the Red5 Pro Server zip file to this instance. SSH into your instance and stop the Red5 Pro service (/etc/init.d/red5pro stop). You may need to install new libraries since the last server release, so check the Linux Install instructions and run through software dependencies. Per "How to Upgrade Red5 Pro Server," Rename your existing red5pro folder to bak.red5pro (sudo mv red5pro bak.red5pro). Copy and unzip the new distribution into the same directory where the original red5pro folder was (e.g. /usr/local/). After it is unzipped, rename that directory to red5pro (sudo mv red5pro-server-* red5pro). Copy the following files from the old build to the new: conf/autoscale.xml, webapps/red5-default.xml, and LICENSE.KEY.

Start the server (/etc/init.d/red5pro start) and hit the IP address at port 5080 to make sure there are no missing dependencies and the server starts correctly.

Handy bash script for copying files between builds, and removing two unnecessary webapps (assumes that old build is now in bak.red5pro and new build is in the red5pro directory):

#!/bin/bash
sudo cp bak.red5pro/conf/autoscale.xml red5pro/conf/
sudo cp bak.red5pro/conf/logback.xml red5pro/conf/
sudo cp bak.red5pro/webapps/red5-default.xml red5pro/webapps/
sudo cp LICENSE.KEY red5pro/
sudo rm -rf red5pro/webapps/secondscreen
sudo rm -rf red5pro/webapps/streammanager

2. Create a new AMI/Image from the updated build

Create a new AMI/Image for Google

See Create Disk Image on Google Cloud platform.

Create a new AMI/Image for AWS

See the Create AMI Image from Instance section of Prepare Red5 Pro AMI for Nodes. Make sure to Copy Red5 Pro AMI to Other Regions if you have nodes/nodegroups in multiple regions.

3. Edit Existing or Create New Launchconfig file

If you have an existing live nodegroup, then you will want to create a new launchconfig file rather than edit the existing one. Otherwise, you run the risk of having a nodegroup with two imcompatible server builds.

Refer to the AWS example or Google Example. Make sure to update image to your new disk image name. By default, per launchconfig.filescandelay value in the Stream Manager red5-web.properties file, new launchconfig files will be processed after 60 minutes. Or you can restart Red5 Pro on the Stream Manager to update immediately.