cluster.xml file, and the cluster plugin handles stream replication between origins and edges at runtime.
Clustering requires a production Red5 Pro license. Trial and Developer license types do not support the clustering plugin.
Terminology
Understanding the role each node plays is essential before you configure anything.Cluster
Cluster
One or more active Red5 Pro server instances working together to make real-time data streams available for consumption. Streams are usually audio and video, but the cluster can carry any real-time data.
Server node
Server node
A single Red5 Pro server instance participating in an active cluster.
Origin
Origin
An origin node accepts publishers. It is the ingest point for live streams. Origins can also serve subscribers directly. A standalone Red5 Pro server acts as both an origin and an edge simultaneously.
Edge
Edge
An edge node accepts subscribers. It connects to one or more origins, pulls stream data from them, and delivers that data to viewers. An edge can be configured to connect to multiple origins for redundancy.
Relay
Relay
An intermediary node that sits between an origin and an edge — used in daisy-chain topologies where geographic distance makes a direct origin-to-edge connection impractical.
Transcoder
Transcoder
A node that performs codec conversion or adaptive bitrate transcoding. Used in Stream Manager autoscaling deployments to convert streams into multiple quality levels.
Broadcaster
Broadcaster
The publishing client — typically a device with a webcam and microphone, a mobile phone, or a software encoder such as OBS. Publishers connect directly to an origin node.
When to use clustering
Multiple concurrent viewers
When a single server cannot sustain the viewer load, add edge nodes. Each edge independently serves subscribers so the origin is not overwhelmed.
Geographic distribution
Place edge nodes closer to your audience. Viewers connect to the nearest edge instead of reaching all the way to the origin.
Publisher redundancy
Add multiple origins so publishers have more than one ingest point. Edges that reference multiple origins reconnect automatically if one origin fails.
Autoscaling
For dynamic workloads, pair clustering with Stream Manager 2.0. Stream Manager provisions and removes nodes automatically in response to load, rather than requiring you to manage a fixed pool.
Configuration reference
All cluster configuration lives inconf/cluster.xml on each Red5 Pro server. The file is a Spring Bean definition. You must restart Red5 Pro after editing it.
Configuring an origin node
On an origin node, theorigins list is left empty because the origin does not connect outward to another server. The key properties to set are password, publicIp, and optionally privateInstance.
1
Open cluster.xml
Edit
conf/cluster.xml in your Red5 Pro installation directory.2
Set the cluster password
Replace
changeme with your chosen password. Use only lowercase letters, numbers, and symbols.3
Set the public IP
Replace
0.0.0.0 in the publicIp property with the public IP address of this origin server.4
Configure round-robin participation
Leave
privateInstance as false if you want the origin to serve subscribers directly alongside the edges. Set it to true if you want subscribers to be routed only to edge nodes.5
Restart Red5 Pro
Any change to
cluster.xml requires a server restart to take effect.conf/cluster.xml (origin)
Configuring an edge node
An edge node must reference at least one origin. It uses the samepassword value and connects outward to each IP in the origins list.
1
Open cluster.xml
Edit
conf/cluster.xml on the edge server.2
Add origin IPs
Uncomment and populate
<value> entries in the origins list with the public IP (and optional port) of each origin. Add one <value> entry per origin.3
Set the same cluster password
Use the identical password you set on the origin. The edge uses this to authenticate when it connects.
4
Set the edge's public IP
Replace
0.0.0.0 in the publicIp property with the public IP of this edge server.5
Configure round-robin participation
Leave
privateInstance as false so that subscribers are routed to this edge. Set it to true to hide this edge from the round-robin servlet.6
Restart Red5 Pro
Restart Red5 Pro on the edge. You can add new edge nodes to a running cluster without restarting the origin.
conf/cluster.xml (edge)
Common cluster topologies
- One origin, one edge
- One origin, three edges
- Multiple origins
- Daisy chain
The simplest multi-server configuration. Both nodes participate in round-robin, so subscribers may be routed to either.Set
privateInstance to false on both the origin and the edge. The edge connects to the origin IP.Publishers connect directly to the origin IP. Subscribers call the round-robin servlet at http://<origin-ip>:5080/cluster and are directed to either the origin or the edge.Round-robin subscriber routing
The round-robin servlet is included in every Red5 Pro installation and requires no configuration changes. Subscribers query it to receive the address of the node they should connect to:privateInstance is false. Your subscriber client then connects to the returned address.
Enabling and disabling clustering
Clustering is enabled by default when the cluster plugin JARs are present.To disable clustering
1
Set nodeType to off
Edit
conf/cluster.xml and change the nodeType property from auto to off:2
Comment out Spring beans
In
webapps/red5-default.xml, comment out the following two bean definitions:3
Remove the plugin JARs
Delete the following files from the
plugins/ directory:red5pro-cluster-plugin-*.jarred5pro-autoscale-plugin-*.jar
4
Restart Red5 Pro
Restart the server. It will run as a standalone node without any cluster participation.
Extending clustering with the application adapter
The cluster API lets you broadcast application-level events — such as room joins — across all nodes in the cluster. TheApplicationAdapter can query whether it is currently running on an edge or an origin, then use the cluster service to dispatch messages to:
- all clustered instances
- all edge nodes only
- all origin nodes only
- a specific instance
- all instances except one or more
ApplicationAdapter events.