Configure Stream Manager Instance
Install Red5 Pro on the Instance:
- SSH into the Stream Manager instance that you created.
- Follow the Installing Red5 Pro on a Linux Server instructions
- Make sure that the Red5 Pro service is set to auto-start on launch
- 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/
-
{red5prohome}/webapps/videobandwidth/
-
Install an SSL certificate on your Stream Manager instance so that it can be used as a proxy for publishers and subscribers. If you aren’t using SSL proxy, it is still recommended that you install an SSL certificate for secure communication.
Import and Activate the Terraform Cloud Controller
Copy the terraform-cloud-controller.jar
into {red5prohome}/webapps/streammanager/WEB-INF/lib/
Edit the applicationContext.xml
file, located at {red5prohome}/webapps/streammanager/WEB-INF/applicationContext.xml
as per the following:
- Locate the
Terraform Cloud controller
“bean” and uncomment it as shown below (note: do not modify the values, only uncomment the bean configuration to make it active):
<!-- TERRAFORM-CLOUD CONTROLLER -->
<bean id="apiBridge"
class="com.red5pro.services.terraform.component.TerraformCloudController">
<property name="operationTimeoutMilliseconds"
value="${terra.operationTimeoutMilliseconds}" />
<property name="regionNames" value="${terra.regionNames}" />
<property name="availabilityZoneNames"
value="${terra.regionNames}" />
<property name="instanceName"
value="${terra.instanceName}" />
</bean>
Comment out (or delete the entry for) the default controller as shown below to disable it:
<!-- Default CONTROLLER -->
<!--
<bean id="apiBridge" class="com.red5pro.services.cloud.sample.component.DummyCloudController" init-method="initialize">
</bean>
-->
Modify Stream Manager App Properties
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 Stream Manager reads all its settings from. Each configurable setting is organized into its own section. For more details on the red5-web.properties file sections, read here.
You will need to modify the following values:
DATABASE CONFIGURATION SECTION
- config.dbHost={host} — the IP address of your MySQL instance
- config.dbPort=3306 — default MySQL port
- 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
.
Corrupted Nodes Check (added with server release 6.2.0)
By default, Stream Manager uses RTMP response from nodes to determine their health (this check originates on the node side). Optionally, you can also monitor HTTP response from the nodes, by modifying the following values in the NODE CONTROLLER
section:
instancecontroller.checkCorruptedNodes=false
— change totrue
to monitor HTTP response from the autoscaling nodes.instancecontroller.corruptedNodeCheckInterval=300000
— frequency of stream manager checks to nodes in milleseconds (default is 5 minutes)instancecontroller.corruptedNodesEndPoint=live
— webapp to monitor. This is set tolive
by default but can be changed to any webapp.instancecontroller.httptimeout=30000
— allowed HTTP response time in milleseconds (30 seconds by default)
CLUSTER CONFIGURATION INFORMATION
cluster.password=changeme
— modify this, and use the same as the password that you will set in thecluster.xml
file on your node image.
TERRAFORM-CLOUD CONTROLLER CONFIGURATION
You will need to uncomment and modify these properties.
terra.regionNames
— This attribute takes a comma-separated list of available regions for Terraform. Currently available Linode regions are:ap-west, ca-central, ap-southeast, us-central, us-west, us-southeast, us-east, eu-west, ap-south, eu-central, ap-northeast
terra.instanceName
— set tolinode-instance
terra.host
— IP address of the terraform server configured earlierterra.port
— Port for accessing the terraform service API; default port is8083
terra.token
— Token configured for Terraform service access (NOT the Linode API token)
REST SECURITY SECTION
rest.administratorToken=
— You need to set a valid password string here before you start using Stream Manager. This is the password that you will use to execute API commands.
WEBSOCKET PROXY SECTION
proxy.enabled
set to true enables, or set to false disables the websocket proxy service. You must use the proxy if you are using WebRTC with Red5 Pro autoscaling.
RED5PRO NODE DEFAULT APPLICATION
- webapp which the stream manager uses for checking node cluster status. The default value is
live
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:
## RED5 APP CONFIGURATION SECTION - Do Not Tamper
webapp.contextPath=/streammanager
webapp.virtualHosts=*
## DATABASE CONFIGURATION SECTION
config.dbHost=db-mysql-nyc1-72895-do-user-6065392-0.db.ondigitalocean.com
config.dbPort=25060
config.dbUser=autoadmin
config.dbPass=abcdefghi1234567
## DATA STORE MANAGEMENT CONFIGURATION SECTION
store.usageStatsDiscardThresholdDays=7
## NODE CONTROLLER CONFIGURATION SECTION - MILLISECONDS
instancecontroller.newNodePingTimeThreshold=150000
instancecontroller.replaceDeadClusters=true
instancecontroller.deleteDeadGroupNodesOnCleanUp=true
instancecontroller.instanceNamePrefix=autonode
instancecontroller.nodeGroupStateToleranceTime=180000
instancecontroller.nodeStateToleranceTime=180000
instancecontroller.cloudCleanupInterval=180000
instancecontroller.blackListCleanUpTime=600000
instancecontroller.pathMonitorInterval=30000
instancecontroller.minimumNodeFreeMemory=50
instancecontroller.checkCorruptedNodes=false
instancecontroller.corruptedNodeCheckInterval=300000
instancecontroller.corruptedNodesEndPoint=live
instancecontroller.httptimeout=30000
## METRIC WEIGHTS FOR BEST NODE EVALUATION SECTION
instanceevaluator.streams.metricweight=30
instanceevaluator.connections.metricweight=15
instanceevaluator.subscribers.metricweight=60
instanceevaluator.memory.metricweight=20
instanceevaluator.restreamer.metricweight=35
## CLUSTER CONFIGURATION INFORMATION
cluster.password=changedme
cluster.publicPort=1935
cluster.accessPort=5080
cluster.reportingSpeed=10000
cluster.retryDuration=30
cluster.mode=auto
cluster.idleClusterPathThreshold=30000
## LOADBALANCING CONFIGURATION
streammanager.ip=
## LOCATIONAWARE CONFIGURATION
location.region=
location.geozone=
location.strict=false
## CLOUD CONTROLLER CONFIGURATION SECTION - MILLISECONDS
## TERRAFORM-CLOUD CONTROLLER CONFIGURATION DIGITAL OCEAN##
terra.regionNames=ap-west, ca-central, ap-southeast, us-central, us-west, us-southeast, us-east, eu-west, ap-south, eu-central, ap-northeast
terra.instanceName=linode-instance
terra.host=192.168.0.123
terra.port=8083
terra.token=abc123
## REST SECURITY SECTION
rest.administratorToken=xyz123
## RED5PRO NODE SERVER API SECTION
serverapi.port=5080
serverapi.protocol=http
serverapi.version=v1
serverapi.accessToken=
## DEBUGGING CONFIGURATION SECTION
debug.logaccess=false
debug.logcachexpiretime=60000
## WEBSOCKET PROXY SECTION
proxy.enabled=true
## SPRING INCLUSION
spring.jackson.default-property-inclusion=non_null
Start Red5 Pro Service to Use the Stream Manager
systemctl start red5pro
Configure Stream Manager Whip/Whep Proxy
To enable Whip and Whep proxying to the edge and origin nodes respectively, the Stream Manager needs to be configured properly. Details on enabling this proxy can be found on the Whip/Whep Configuration page in the Stream Manager section.