Configure and Deploy Stream Manager
Note: after the Stream Manager instance is started up, you will need to add its Private IP address to the Database Security group, per the DB security step above
New Server Instance
- Navigate to the EC2 Dashboard, in the region where you reserved the streammanager IP address
- Click on Launch Instance.
- Step 1: Choose an Amazon Machine Image (AMI) – click on My AMIs, and select the AMI that you just created for the nodes.
- Step 2: Choose an Instance Type – we suggest selecting a multi-cpu instance type with high network performance (for example,
m5.large
). Click on Next: Configure Instance Details - Step 3: Configure Instance Details – Network: chose the VPC and a non-wavelength subnet that you set up earlier for this region; accept other defaults. Click on Next: Add Storage.
- Step 4: Add Storage – the default disk size should be sufficient. Click on Next: Tag Instance, then Next: Configure Security Group
- Step 6: Configure Security Group – Create a new security group with the following ports allowed from anywhere (optionally, you can restrict SSH access to your network):
Port | Description | Protocol |
---|---|---|
22 | SSH | TCP |
5080 | default web access of Red5 Pro; websockets for WebRTC / Stream Manager | TCP |
443 | modified https access of Red5 Pro; secure websockets for WebRTC / Stream Manager | TCP |
- Click on Review And Launch, then Launch – Select the keypair that you added, or create a new one to use exclusively on this machine.
- Make a note of the instance ID – will need this to associate the Elastic IP address.
Associate the reserved IP address with this instance:
- From the left-hand navigation, under NETWORK & SECURITY, select Elastic IPs
- Choose the IP address that you reserved
- Actions, Associate Address
- Select the Stream Manager instance from the list. Accept the defaults. Click on Associate
Configure the Stream Manager Instance
- SSH into the Stream Manager instance
- Stop the Red5 Pro service (
sudo systemctl stop red5pro
) - If you haven’t already, Install NTP (network time protocol)
- Navigate to the directory where you installed Red5 Pro (e.g.
/usr/local/red5pro
)
Delete the following files/directories:
{red5prohome}/conf/autoscale.xml
{red5prohome}/plugins/red5pro-autoscale-plugin-*
{red5prohome}/plugins/red5pro-webrtc-plugin-*
{red5prohome}/plugins/inspector.jar
{red5prohome}/webapps/inspector/
These additional files/directories should be deleted for server optimization:
{red5prohome}/plugins/red5pro-restreamer-plugin-*
{red5prohome}/plugins/red5pro-mpegts-plugin-*
{red5prohome}/plugins/red5pro-socialpusher-plugin-*
{red5prohome}/webapps/api/
{red5prohome}/webapps/bandwidthdetection/
- `{red5prohome}/webapps/template/
Import and Activate AWS Cloud Controller
Copy the aws-cloud-controller-{red5prohome}/webapps/streammanager/WEB-INF/lib/
Edit the applicationContext.xml file, located at {red5prohome}/webapps/streammanager/WEB-INF/applicationContext.xml
per the following:
- Locate the AWS controller “bean” and uncomment it as shown below (note: do not modify the values, only uncomment the bean configuration to make it active):
Comment out (or delete the entry for) the default controller as shown below to disable it:
Modify Stream Manager App Properties (red5-web.properties)
Refer to your AWSAutoScalingChecklist.rtf for the data needed to complete this section.
The Stream Manager’s configuration details are stored in the red5-web.properties file, found in:
{red5prohome}/webapps/streammanager/WEB-INF/red5-web.properties
. This is where streammanager reads all its settings from. Each configurable setting is organized into its own section.
You will need to modify the following values:
DATABASE CONFIGURATION SECTION
- config.dbHost={host} — the DB Endpoint URL of your MySQL server instance (or
localhost
if you are running MySQL on the SM instance) - config.dbUser={username} — Database Master Username
- config.dbPass={password} — Database Master Password
NODE CONTROLLER CONFIGURATION SECTION – MILLISECONDS
- instancecontroller.replaceDeadClusters=true — The default value of
true
will automatically replace any clusters that have failed. If you set this value tofalse
then a failed nodegroup will be deleted and not replaced. - instancecontroller.deleteDeadGroupNodesOnCleanUp=true — by default, any unresponsive nodes will be deleted from the dashboard. Setting this value to
false
will stop the instances, but not delete them. note thefalse
variable is not supported with terraform. - instancecontroller.instanceNamePrefix={unique-value} — the
unique-value
must be modified with an identifier to pre-pend nodes that are created by the stream manager. It is critical that this value be different if you have multiple environments (eg, develop, staging, production), otherwise the stream manager will remove nodes with that prefix that are not in its database. Also note – if you usenode
in one environment andnodedev
in a second environment, the first stream manager will remove thenodedev
instances because it sees them as instances starting withnode
.
CLUSTER CONFIGURATION INFORMATION
- cluster.password=changeme — modify this to be the same as the password that you set in the
cluster.xml
file on your disk image.
AWS CLOUD CONTROLLER CONFIGURATION
You will need to un-comment and configure the following entries:
- aws.defaultzone={default-region} — the default region for your autoscaling
- aws.operationTimeoutMilliseconds=20000 — estimated time to start a new VM. recommend changing this to 400000 to account for wavelength zones
- aws.accessKey = {account-accessKey} — IAM access key
- aws.accessSecret = {account-accessSecret} — IAM access secret
- aws.ec2KeyPairName = {keyPairName} — SSH keypair name for connecting to nodes
- aws.ec2SecurityGroup ={securityGroupName} — node security group name
REST SECURITY SECTION
- rest.administratorToken= — You need to set a valid password string here before you start using streammanager. This is the password that you will use to execute API commands
WEBSOCKET PROXY SECTION
proxy.enabled
set totrue
enables, or set tofalse
disables the websocket proxy service. You must use the proxy if you are using WebRTC with Red5 Pro autoscaling.
DEBUGGING CONFIGURATION SECTION
debug.logaccess
— Set to true if you want to allow access to log files via REST API. This can be especially useful during development on the cloud, however if your stream manager is behind a load balancer this call will not work. For more information, refer to the Stream Manager Rest API.
Please note that if you modify any of the above values after your initial deployment, you will need to restart the Red5 Pro service.
Sample red5-web.properties file content:
Start Red5 Pro Service to Use the Stream Manager
sudo systemctl start red5pro
Configure Stream Manager with SSL
You must set up the Stream Manager with a valid SSL certificate and use the Stream Manager SSL Proxy feature. Please refer to this document to configure SSL on your Red5 Pro Stream Manager.