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.
| Property | Description | Default |
|---|---|---|
origins | List of origin IP addresses (and optional ports) that an edge connects to. Leave empty on a pure origin node. | empty |
password | Shared secret used by edges to authenticate with origins. Must be identical across all nodes in a cluster. Lowercase only — no capital letters. | changeme |
publicIp | The public IP address of the current server. Used by the round-robin servlet to return the correct address to subscribers. | 0.0.0.0 |
publicPort | The RTMP port that this server is reachable on. | 1935 |
privateInstance | When true, this node is excluded from the round-robin subscriber routing. Set to true on origins you want to reserve for publishing only. | false |
retryDuration | Seconds an edge waits before retrying a lost connection to an origin. | 30 |
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.
Set the cluster password
Replace
changeme with your chosen password. Use only lowercase letters, numbers, and symbols.Set the public IP
Replace
0.0.0.0 in the publicIp property with the public IP address of this origin server.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.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.
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.Set the same cluster password
Use the identical password you set on the origin. The edge uses this to authenticate when it connects.
Set the edge's public IP
Replace
0.0.0.0 in the publicIp property with the public IP of this edge server.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.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
Comment out Spring beans
In
webapps/red5-default.xml, comment out the following two bean definitions:Remove the plugin JARs
Delete the following files from the
plugins/ directory:red5pro-cluster-plugin-*.jarred5pro-autoscale-plugin-*.jar
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.