Using Wowza Media Server | Load Balancing | Setup
Posted By : Amit Kumar | 18-Feb-2014
Setup Load Balancing in Wowza Media Server
As we all know that the load balancing helps to spread the workload over network so that the current server do not get oveloaded. This judgement is based on network traffic.
Now this blog will help you to deploy and setup Load Balancing in Wowza Media Server
Requirement :
We need minimum two server(one for Listener and rest are Sender i.e edge server), and both will have its own copy of Wowza Media Server installed.
Load Balancer Server as Listener
One server that will be configured as Lisener Server, will listen all request from sender and provides the least loaded edge server. The server will running the ServerListenerLoadBalancerListener. Load Balancer have all information of its edge server.
Edge Server as Sender
Second server which is Edge server, is configured to use the ServerListenerLoadBalancerSender ServerListener class. Edge servers will send load and status information to Listener server and it will give least loaded server information.
Configuration on Load Balancer Server (Listener)
Configuration need change in wowza configuration file in Load Balancer. Here is the Steps.
Step 1:
Download the Wowza Media Server 2 Preview 7 from this link http://www.wowza.com/forums/content.php?108
Step 2:
Copy the file lib/wms-plugin-loadbalancer.jar from this zip archive to the [install-dir]/lib/ folder of Wowza Media Server 2.
Step 3:
Copy the file conf/crossdomain.xml from this zip archive to the [install-dir]/conf/ folder of Wowza Media Server 2.
Step 4:
Edit [install-dir]/conf/Server.xml and Add ServerListener entry to the
-
Code Snippet :-
loadBalancerListenerKey 023D4FB4IS83 loadBalancerListenerIpAddress * loadBalancerListenerPort 1934 Integer loadBalancerListenerRedirectorClass com.wowza.wms.plugin.loadbalancer.LoadBalancerRedirectorConcurrentConnects loadBalancerListenerMessageTimeout 5000 Integer
Step 5:
Edit [install-dir]/conf/VHost.xml and add the following HostPort/HTTPProvider XML snippet just before the HTTPProvider definition for com.wowza.wms.http.HTTPServerVersion:
-
Code Snippet :-
com.wowza.wms.plugin.loadbalancer.HTTPLoadBalancerRedirector *loadbalancer none enableServerInfoXML true Boolean
Configuration need change in wowza configuration file in Edge Server. Here is the Steps.
Download the Wowza Media Server 2 Preview 7 from this link http://www.wowza.com/forums/content.php?108
Copy the file lib/wms-plugin-loadbalancer.jar from this zip archive to the [install-dir]/lib/ folder of Wowza Media Server 2.
Edit [install-dir]/conf/Server.xml and make the following changes. Add the following ServerListener entry to the
Code Snippet :-
Edit [install-dir]/conf/VHost.xml and add the following HostPort/HTTPProvider XML snippet just before the HTTPProvider definition for com.wowza.wms.http.HTTPServerVersion:
Code Snippet :-
Where [redirect-address] is the ip address of this machine.
Create the file [install-dir]/conf/loadbalancertargets.txt and add below Code.
Code Snippet :-
Where [load-balancer-ip-address] is the ip address load balancer server.
Start both server and test these.
Use this Url to test : http://[load-balancer-ip-address]:1935/loadbalancer?serverInfoXML
or
http://[load-balancer-ip-address]:1935/loadbalancer
[Note: Please do not copy the wowza media server installation zip from one server to another because they have used unique guid]
Thanks
Amit
Configuration on Edge Server (Sender)
Step 1:
Step 2:
Step 3:
Step 4:
Step 5:
# [load-balancer-ip-address],[load-balancer-port],[encryption-key]
[load-balancer-ip-address],1934,023D4FB4IS83
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Amit Kumar
Amit is a bright Groovy and Grails developer and has worked on development of various SaaS applications using Grails framework.