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 list:

  • 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 on Edge Server (Sender)

Configuration need change in wowza configuration file in Edge Server. 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:

 

Edit [install-dir]/conf/Server.xml and make the following changes. Add the following ServerListener entry to the list:

  • Code Snippet :-

    
            loadBalancerListenerKey
            023D4FB4IS83
    
    
            loadBalancerListenerIpAddress
            *
    
    
            loadBalancerListenerPort
            1934
            Integer
    
    
            loadBalancerListenerRedirectorClass
            com.wowza.wms.plugin.loadbalancer.LoadBalancerRedirectorConcurrentConnects
    
    
            loadBalancerListenerMessageTimeout
            5000
            Integer
    
    

 

Step 4:

 

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.ServerListenerLoadBalancerSender
    
    Add the following properties to the  section at the bottom of Server.xml:
    
            loadBalancerSenderTargetPath
            ${com.wowza.wms.AppHome}/conf/loadbalancertargets.txt
    
    
            loadBalancerSenderRedirectAddress
            [redirect-address]
    
    
            loadBalancerSenderMonitorClass
            com.wowza.wms.plugin.loadbalancer.LoadBalancerMonitorDefault
    
    
            loadBalancerSenderMessageInterval
            2500
            Integer
    
    
    
  • Where [redirect-address] is the ip address of this machine. 

 

Step 5:

 

Create the file [install-dir]/conf/loadbalancertargets.txt and add below Code.

  • Code Snippet :-

    # [load-balancer-ip-address],[load-balancer-port],[encryption-key]
    [load-balancer-ip-address],1934,023D4FB4IS83
    
  • 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

 

About Author

Author Image
Amit Kumar

Amit is a bright Groovy and Grails developer and has worked on development of various SaaS applications using Grails framework.

Request for Proposal

Name is required

Comment is required

Sending message..