• How to load balance between servers on Google Cloud Platform

    The Dynamic Load Balancing AddOn enables you to redirect client connections across multiple Wowza Streaming Engine™ media server installations when a single Wowza Streaming Engine instance can't service all of the connections. A load-balancing configuration requires you to set up a Wowza™ load balancer server that directs client connections to additional Wowza servers that handle the connections.

    This article describes how to use the Wowza Dynamic Load Balancing AddOn to balance client connections between edge server virtual machine instances on Google Compute Engine, part of Google Cloud Platform. In this example, we use an origin server virtual machine instance and two edge server virtual machine instances in a repeater configuration; the edge server instances and a load balancer server are configured to use the Dynamic Load Balancing AddOn to distribute client connections between the edge servers instances.

    Notes:

    Contents


    Getting started
    Create and configure an origin server instance
    Create and configure an edge server instance
    Create and configure the load balancer server instance
    Viewing load balancer statistics
    Redirection
    More resources

    Getting started


    Wowza Media Systems provides Google Cloud Platform with pre-configured and tuned Wowza Streaming Engine images that are ready to start using with Google Compute Engine. Compute Engine is a Google Cloud Platform web service that provides resizable compute capacity in the cloud and virtualizes computing resources as virtual machines.

    Before you can create a Wowza load balancing system with Google Cloud Platform, you must create a new project. Follow the directions in How to set up Wowza for Google Cloud Platform to create a project, add the Wowza Streaming Engine image to the project, and add a firewall rule. All Google Compute Engine server instances created in this example are part of this project.

    Create and configure an origin server instance


    The Google Cloud Platform Console is a web interface that enables you to manage your Compute Engine resources from a web browser.

    Create a new server instance using the Google Cloud Platform Console

    After creating and configuring the Google Cloud Platform project, you're ready to create the origin server.

    1. Sign in to the Google Cloud Platform Console. In your project dashboard page contents panel, click the Products and Services menu icon, under Compute click Compute Engine, and then click Images.



    2. In the Images list, select the name of the Wowza Streaming Engine image that you added, and then click New instance.

    3. On the Create a new instance page, complete the following options:

      1. Give your instance a name. The name must start with a lowercase letter, followed by 1-62 lowercase letters, numbers, or hyphens, and can't end with a hyphen.

      2. Select a Zone. The zone determines what computing resources are available and where your data is stored and used.

      3. Select a Machine Type. The machine type determines the CPU and memory your instance will have. Machine types with large scratch disks (or persistent storage) are recommended for on demand streaming, nDVR, and for recording live streams.

        The n1-standard-1 machine type is selected by default, but we recommend a minimum machine type of 1vCPU. To select a different machine type, click the down arrow, select a machine type from the list, and then click to select.

        Notes:
        • For more information about available machine types, see Machine Types. Wowza Streaming Engine works with most of the Google Compute Engine machine types, with the exception of the Shared-core machine types.

        • Each machine type is billed differently. For more information, see Machine type pricing.
      4. In Boot disk, change the disk used to boot the instance (if desired). To select a different disk type:

        1. Click Change.

        2. On the Your image tab, click the name of the Wowza Streaming Engine image that you added.

        3. In Boot disk type, select either Standard persistent disk (the default value) or SSD persistent disk. For more information, see Persistent Disks.

        After the operating system and Wowza Streaming Engine are installed, the base machine will have about 8GB of free disk space.

      5. Enter key:value pairs for your Wowza Streaming Engine software license key (or license keys), startup package, and a user name and password that enables you to sign in to Wowza Streaming Engine Manager:

        1. Click the Management, disk, networking, access & security options section to expand it.

        2. On the Management tab, in Metadata, enter the following key:value pairs. After you enter a key:value pair, the console will enable you to enter another one.

          To enter a license key (required):

          • In Key, enter WZA_serverLicenseKey, and then in Value, enter <your valid Wowza media server software license key>.

          To specify Wowza Streaming Engine Manager user name (optional, but recommended):

          • Click Add item, and then in Key, enter WZA_managerUsername, and in Value, enter <a valid user name>.

          To specify Wowza Streaming Engine Manager password (optional, but recommended):

          • Click Add item, and then in Key, enter WZA_managerPassword, and in Value, enter <a valid password>.

        3. Under the Networking tab, in External IP, select New Static IP address.

          • Enter Name, and optional Description, then click Reserve.

          Notes:
          • We recommend using a static IP address instead of Ephemeral when configuring a Load Balancer, as Ephemeral addresses may change if the Instance is shutdown.

          • Make sure to note the External IP address for your new instance. You'll need it when configuring the load balancer server.
        4. Click Create. The new instance is available in your project.


    Configure an origin server instance

    After you have launched the newly deployed origin server instance and logged in to the Wowza Streaming Engine Manager, complete the steps to configure a live stream repeater on an origin server.


    Create and configure an edge server instance


    Next, you must create and configure one or more load-balancing edge servers to fulfill client requests that are redirected to them from the load balancer server:

    1. Repeat the steps to create a new server instance using the Google Cloud Platform Console. This new instance will become an edge server.

    2. Complete the steps to configure a live stream repeater on an edge server.

    3. Download and install the Dynamic Load Balancing AddOn package files on an edge server instance.

    4. Add the load balancer server listener to an edge server instance.

    5. Add the load balancing properties to an edge server instance.

    Install the Dynamic Load Balancer AddOn package files


    1. In the Google Cloud Platform Console, click the Products and Services menu icon, under Compute click Compute Engine, click VM instances, and then select the edge server instance.

    2. At the top of the selected instance screen, click on SSH.



    3. On the SSH screen, complete the following:

      1. Copy the Load Balancer package to your edge server:
        sudo wget http://www.wowza.com/downloads/forums/loadbalancer/LoadBalancer_4.0.zip -P /usr/local/
      2. Change directory to /usr/local:
        cd /usr/local/
      3. Unzip the LoadBalancer package:
        sudo unzip LoadBalancer_4.0.zip -d/usr/local/LoadBalancer
      4. Copy the /usr/local/LoadBalancer/lib/wms-plugin-loadbalancer.jar file to the [install-dir]/lib/ folder in the Wowza Streaming Engine installation:
        sudo cp /usr/local/LoadBalancer/lib/wms-plugin-loadbalancer.jar /usr/local/WowzaStreamingEngine/lib/
      5. Restart the Wowza Streaming Engine:
        /etc/init.d/WowzaStreamingEngine restart
      6. Close your SSH terminal window.

    Note: For detailed installation instructions, see the Wowza Dynamic Load Balancing AddOn User's Guide.

    Add the load balancer server listener

    The Load Balancer Server Listener must be added to each edge server instance.

    Note: Access to the Server Listeners tab requires an administrator user with advanced permissions. See How to enable Advanced User Permissions for more information.
    To add the load balancer server listener:

    1. In Wowza Streaming Engine Manager, click the Server tab and then click Server Setup in the contents panel.

    2. On the details page, click the Server Listeners tab.



    3. Click Edit and then click Add Server Listener.

    4. In the Add Server Listener dialog box, enter com.wowza.wms.plugin.loadbalancer.general.LoadBalancerServer (the fully qualified class name) as the Base Class, and then click Add.



    5. Click Save and then restart the server.


    Add load balancing properties to an edge server instance

    Next, the load balancing properties must be added to the edge servers.

    Note: The following steps list the minimum recommended set of properties that should be used with the edge server listener. See the Wowza Dynamic Load Balancing AddOn User's Guide for more information about these and additional load balancing properties.

    Wowza Streaming Engine Manager configuration


    1. In Wowza Streaming Engine Manager, click the Server tab.

    2. On the Server Setup page Properties tab, click Custom in the Quick Links bar.

      Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
    3. In the Custom area, click Edit.

    4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:

      • Path - Select Root/Path.

      • Name - Enter loadbalanceType.

      • Type - Select String.

      • Value - Enter Client. In the load-balancing configuration, servers that fulfill client requests that are directed to it from the load balancer server have the value Client.

    5. Repeat for each of the following properties:

      Path
      Name
      Type
      Value
      Notes
      Root/Server loadbalanceKey String 1234abcd Enables encrypted communication between the Load Balancer and Servers. The value must be at least 8 characters long and must be the same on all servers in the configuration.
      Root/Server loadbalanceServerIP String x.x.x.x IP address of the Load Balancer Server Instance.
      Root/Server loadbalanceServerPort String 1935 Port that the Load Balancer runs on. By default, this should be set to 1935 or to any other port that's configured in your VHost.xml file.
      Root/Server loadbalanceBandwidthEnable String On Controls bandwidth monitoring. The default value is Off. To enable bandwidth monitoring, set this value to On, and then configure the loadbalanceBandwidthLimit property.
      Root/Server loadbalanceBandwidthLimit String 50000 The bandwidth limit for this Server, in kilobits per second (kbps). For example, if you want this Server to provide only 50 megabits per second (Mbps) of throughput, set the value to 50000. To allow unlimited bandwidth, set to 0.
      If all Servers in the load-balancing deployment are saturated, redirection will fail and you must add an additional load-balancing Server to increase capacity.
      Root/Server loadbalanceConnectionEnable String On Controls connection balancing. The default value is Off. To enable connection balancing, set this value to On, and then configure the loadbalanceConnectionLimit property.
      Root/Server loadbalanceConnectionLimit String 100 The limit for outgoing connection on this Server. To allow an unlimited number of connections, set to 0.
      If all Servers in the load-balancing deployment are servicing the maximum number of connections, redirection will fail and you must add an additional load-balancing Server to increase capacity.

    6. Click Save and restart the server to apply the changes.

    XML Configuration


    Alternatively, you can add the load balancer properties directly to the Server.xml file:

    1. In the Google Cloud Platform Console, click the Products and Services menu icon, under Compute click Compute Engine, click VM instances, and then select the edge server instance.

    2. At the top of the selected instance screen, click on SSH.

    3. In a text editor, edit the [install-dir]/conf/Server.xml file, and insert the following property elements in the <Properties> list at the bottom of the file:
      <!-- Properties defined here will be added to the IServer.getProperties() collection -->
                  <Property>
                      <Name>loadbalanceType</Name>
                      <Value>Client</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceKey</Name>
                      <Value>[8 Character Key]</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceServerIP</Name>
                      <Value>[Load Balancer (not this Server) IP address (xxx.xxx.xxx.xxx)]</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceServerPort</Name>
                      <Value>1935</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceBandwidthEnable</Name>
                      <Value>On</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceBandwidthLimit</Name>
                      <Value>50000</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceConnectionEnable</Name>
                      <Value>On</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceConnectionLimit</Name>
                      <Value>100</Value>
                      <Type>String</Type>
                  </Property>
      Note: See the Wowza Dynamic Load Balancing AddOn User's Guide for details about these and additional properties.
    4. Modify the loadbalancerServerIP and loadbalanceKey properties to use the appropriate IP address and key. The other properties can be used without modification or modified as needed.

    5. Restart the Wowza Streaming Engine:
      /etc/init.d/WowzaStreamingEngine restart
    6. Close your SSH terminal window.

    7. Repeat this process for each edge server.


    Create and configure the load balancer server


    A load-balancing configuration requires you to set up a Wowza load balancer server that directs client connections to additional Wowza edge servers that handle the connections. The edge servers periodically send load and status information to the load balancer so that it can track edge server load and availability. All communication between the edge servers and the load balancer is encrypted and signed. To create and configure the load balancer server instance:

    1. Repeat the steps to create a new server instance using the Google Cloud Platform Console. This new instance will become the load balancer server.

    2. Repeat the procedure to install the LoadBalancer package files on the load balancer server instance.

    3. Repeat the procedure to add the load balancer server listener to the load balancer server instance.

    4. Add the load balancing server properties to the load balancer server instance.

    5. Add HTTP Providers to the load balancer server instance.

    Add load balancing server properties to the load balancer server instance

    Next, the load balancing properties must be added to the load balancer server.

    Note: The following steps list the minimum recommended set of properties that should be used with the edge server listener. See the Wowza Dynamic Load Balancing AddOn User's Guide for more information about these and additional load balancing properties.

    Wowza Streaming Engine Manager configuration


    1. In Wowza Streaming Engine Manager, click the Server tab.

    2. On the Server Setup page Properties tab, click Custom in the Quick Links bar.

      Note: Access to the Properties tab is limited to administrators with advanced permissions. For more information, see Manage credentials.
    3. In the Custom area, click Edit.

    4. Click Add Custom Property, specify the following settings in the Add Custom Property dialog box, and then click Add:

      • Path - Select Root/Path.

      • Name - Enter loadbalanceType.

      • Type - Select String.

      • Value - Enter Server or Server,Client. In the load-balancing configuration, servers that redirect client requests to load-balancing edge servers have a the value Server. Servers that both redirect client requests and fulfill client requests have the value Server,Client.

    5. Repeat for each of the following properties:

      Path
      Name
      Type
      Value
      Notes
      Root/Server loadbalanceKey String 1234abcd Enables encrypted communication between the Load Balancer and Servers. The value must be at least 8 characters long and must be the same on all servers in the configuration.
      Root/Server loadbalanceServerIP String x.x.x.x IP address of the Load Balancer Server Instance.
      Root/Server loadbalanceServerPort String 1935 Port that the Load Balancer runs on. By default, this should be set to 1935 or to any other port that's configured in your VHost.xml file.
      Root/Server loadbalanceDecisionOrder String Bandwidth,Connection Order in which decision-making is processed for load balancing. Some or all of the following values can be entered as a comma-separated list:
      Geographic Select load balancing Servers based on the geographic selector.
      Bandwidth Select load balancing Servers based on the bandwidth selector.
      Connection Select load balancing Servers based on the connection selector.
      For example, to specify geographic-based and then connection-based load balancing, the value is:
      Geographic,Connection
      Root/Server loadbalanceIgnoreClients String FMLE A comma-separated list of client names. Clients with these names can connect to the Load Balancer and not be redirected. For example, you can specify the client name FMLE to enable a client that has Flash Media Encoder installed to connect.
      Root/Server loadbalanceBandwidthEnable String On Controls bandwidth monitoring. The default value is Off. To enable bandwidth monitoring, set this value to On, and then configure the loadbalanceBandwidthLimit property.
      Root/Server loadbalanceBandwidthLimit String 50000 The bandwidth limit for this Server, in kilobits per second (kbps). For example, if you want this Server to provide only 50 megabits per second (Mbps) of throughput, set the value to 50000. To allow unlimited bandwidth, set to 0.
      If all Servers in the load-balancing deployment are saturated, redirection will fail and you must add an additional load-balancing Server to increase capacity.
      Root/Server loadbalanceConnectionEnable String On Controls connection balancing. The default value is Off. To enable connection balancing, set this value to On, and then configure the loadbalanceConnectionLimit property.
      Root/Server loadbalanceConnectionLimit String 100 The limit for outgoing connection on this Server. To allow an unlimited number of connections, set to 0.
      If all Servers in the load-balancing deployment are servicing the maximum number of connections, redirection will fail and you must add an additional load-balancing Server to increase capacity.
      Root/Server loadbalanceAllowRemoteClientShutdown String On (Optional) Enables load-balancing Servers to be shut down via the Statistics web interface.

    6. Click Save and restart the server to apply the changes.

    XML Configuration


    Alternatively, you can add the load balancer properties directly to the Server.xml file:

    1. In the Google Cloud Platform Console, click the Products and Services menu icon, under Compute click Compute Engine, click VM instances, and then select the load balancer server instance.

    2. At the top of the selected instance screen, click on SSH.

    3. In a text editor, edit the [install-dir]/conf/Server.xml file, and insert the following property elements in the <Properties> list at the bottom of the file:
                  <Property>
                      <Name>loadbalanceType</Name>
                      <Value>Server</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceKey</Name>
                      <Value>1234abcd</Value>
                      <Type>String</Type>
                  </Property>
                  <Property>
                      <Name>loadbalanceServerIP</Name>
                      <Value>[Load Balancer IP address (x.x.x.x)]</Value>
                      <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceServerPort</Name>
                       <Value>1935</Value>
                       <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceDecisionOrder</Name>
                       <Value>Bandwidth,Connection</Value>
                       <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceIgnoreClients</Name>
                       <Value>FMLE</Value>
                       <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceBandwidthEnable</Name>
                       <Value>On</Value>
                       <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceBandwidthLimit</Name>
                       <Value>50000</Value>
                       <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceConnectionEnable</Name>
                       <Value>On</Value>
                       <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceConnectionLimit</Name>
                       <Value>100</Value>
                       <Type>String</Type>
                   </Property>
                   <Property>
                       <Name>loadbalanceAllowRemoteClientShutdown</Name>
                       <Value>On</Value>
                       <Type>String</Type>
                   </Property>
    4. Modify the loadbalancerServerIP and loadbalanceKey properties to use the appropriate IP address and key. The other properties can be used without modification or modified as needed.

    5. Restart the Wowza Streaming Engine:
      /etc/init.d/WowzaStreamingEngine restart/
    6. Close your SSH terminal window.


    Add HTTP Providers to the load balancer server instance

    Next, you must add the LoadBalancerPublicInterface and LoadBalancerInterface HTTP Providers to the load balancer server instance:

    1. In the Google Cloud Platform Console, click the Products and Services menu icon, under Compute click Compute Engine, click VM instances, and then select the load balancer server instance.

    2. At the top of the selected instance screen, click on SSH.

    3. In a text editor, edit the [install-dir]/conf/VHost.xml file, and add the following HTTP Providers to the top of the <HTTPProviders> list for the default streaming host port. Make sure these HTTP Providers are the first entries in the <HTTPProviders> list:
      <HTTPProvider>
      	<BaseClass>com.wowza.wms.plugin.loadbalancer.http.LoadBalancerPublicInterface</BaseClass>
      	<RequestFilters>redirect*</RequestFilters>
      	<AuthenticationMethod>none</AuthenticationMethod>
      </HTTPProvider>
      <HTTPProvider>
      	<BaseClass>com.wowza.wms.plugin.loadbalancer.http.LoadBalancerInterface</BaseClass>
      	<RequestFilters>*loadbalancerInterface</RequestFilters>
      	<AuthenticationMethod>none</AuthenticationMethod>
      </HTTPProvider>
      Note: See the Wowza Dynamic Load Balancing AddOn User's Guide for details about these HTTP Providers and for an example that shows the VHost.xml configuration for the Load Balancer.
    4. Restart the Wowza Streaming Engine:
      /etc/init.d/WowzaStreamingEngine restart/
    5. Close your SSH terminal window.


    Viewing Load Balancer Statistics


    A statistics interface enables you to see connected edge servers and the bandwidth and countries allocated for them. It also enables you to shut down edge servers, removing them from the configuration while leaving other connected edge servers unaffected.

    To configure this interface, repeat the steps in Add HTTP Providers to the load balancer server instance to add the following LoadBalancerInfo HTTP Provider to the load balancer server instance, making sure to add it above the HTTP Provider that has the <RequestFilters>*</RequestFilters> property:
    <HTTPProvider>
    	<BaseClass>com.wowza.wms.plugin.loadbalancer.http.LoadBalancerInformation</BaseClass>
    	<RequestFilters>*loadbalancerInfo</RequestFilters>
    	<AuthenticationMethod>admin-digest</AuthenticationMethod>
    </HTTPProvider>
    After the HTTP Provider is added, you can view the connected Servers and their status in a web browser. For example:
    http://[load-balancer-ip-address]:1935/loadbalancerInfo
    The web-based interface includes a button for each server entry that enables you to remove the server from the configuration. This process takes 60 seconds to occur. The server status displays STOP in the statistics information panel until it's completely removed.



    Redirection


    The load-balancing redirection interfaces on the Load Balancer server enable you to provide a single URL to clients in the following basic form:

    [protocol]://[load-balancer-ip-address]:1935/redirect/[application-name]/[stream-name]?scheme=[http-transmission-scheme]
    The [load-balancer-ip-address] is a placeholder for the IP address of the load balancer server instance. The scheme URL query is used to specify the manifest file format in the redirect URL that's returned to clients, and is only used for HTTP redirection. The scheme URL query isn't used for RTMP or RTSP redirection.

    A client is then redirected to an available load-balancing server via a URL that has the following basic form:

    [protocol]://[load-balanced-server-ip-address]:1935/[application-name]/[stream-name]?[manifest]
    Notice that /redirect is removed in the URL the client is redirected to. Depending on the load on the system, the [load-balanced-server-ip-address] is either the IP address of the load balancer server or the IP address of one of the load-balancing edge servers that you configured.

    Note: When the loadbalanceType property value is set to Server,Client on the load balancer server, it's also a load-balancing server that can fulfill the client request if it isn't overloaded. Setting this property value to Server means that the load balancer will redirect all client requests to connected load-balancing edge servers.
    A Wowza load-balancing system running on Wowza Streaming Engine software supports redirection over the following protocols:

    • HTTP
    • RTMP
    • RTSP

    HTTP Redirection

    The HTTP redirection interface enables you to provide a single URL that redirects clients to an available load-balancing server without any additional configuration.

    Note: HTTP clients are redirected using the HTTP 302 response status code. Your client must support the HTTP 302 code for load balancing to work. RTMP clients that use HTTP requests must support the returned XML.

    Apple HLS (M3U8)


    The following is an example redirect URL for Apple HLS clients:
    http://[load-balancer-ip-address]:1935/redirect/[application-name]/[stream-name]?scheme=m3u8
    The Apple HLS clients are redirected to:
    http://[load-balanced-server-ip-address]:1935/[application-name]/[stream-name]/playlist.m3u8

    Adobe HDS (F4M)


    The following is an example redirect URL for Adobe HDS clients:
    http://[load-balancer-ip-address]:1935/redirect/[application-name]/[stream-name]?scheme=F4M
    The Adobe HDS clients are redirected to:
    http://[load-balanced-server-ip-address]:1935/[application-name]/[stream-name]/manifest.f4m

    Microsoft Smooth Streaming (Manifest)


    The following is an example redirect URL for Smooth Streaming clients:
    http://[load-balancer-ip-address]:1935/redirect/[application-name]/[stream-name]?scheme=Manifest
    The Smooth Streaming clients are redirected to:
    http://[load-balanced-server-ip-address]:1935/[application-name]/[stream-name]/Manifest

    RTMP XML


    Note: Not all RTMP clients support XML redirection over HTTP.
    The following is an example URL that redirects RTMP clients over HTTP:
    http://[load-balancer-ip-address]:1935/redirect/[/url][application-name]/[stream-name]/loadbalancer.smil
    This returns XML similar to the following to RTMP clients using HTTP requests:
    <xml version="1.0"?>
    	<smil>
    		<head>
    			<meta base="[load-balanced-server-ip-address]:1935/[application-name]/" />"
    		</head>
    		<body>
    			<video src="[stream-name]" />
    		</body>
    	</smil>

    RTMP and RTSP Redirection

    Note: Not all RTMP clients support redirection via the RTMP protocol.
    Using RTMP and RTSP redirection functionality requires the addition of an application and and a redirection module to the load balancer server instance.

    The redirection module returns an RTMP or RTSP redirect to clients that connect to the Load Balancer server, except for those that are configured to be ignored in the loadbalanceIgnoreClients property in the Server.xml file. Wowza edge servers that connect to a load balancer that's also an origin server in a live stream repeater (origin/edge) configuration are also ignored.

    RTMP


    The following is an example redirect URL for RTMP clients:
    rtmp://[load-balancer-ip-address]:1935/redirect/[application-name]/[stream-name]
    The RTMP clients are redirected to:
    rtmp://[load-balanced-server-ip-address]:1935/[application-name]/[stream-name]

    RTSP


    The following is an example redirect URL for RTSP clients:
    rtsp://[load-balancer-ip-address]:1935/redirect/[application-name]/[stream-name]
    The RTSP clients are redirected to:
    rtsp://[load-balanced-server-ip-address]:1935/[application-name]/[stream-name]

    Add RTMP and RTSP redirection functionality to the load balancer server:


    1. Add a new live application named redirect to the Load Balancing Server:

      1. In Wowza Streaming Engine Manager, click the Applications tab and then click Add Application in the contents panel.

      2. On the Add Application page, click the Live button to select that application type.

      3. In the New Application box, enter a redirect and then click Add.


    2. Add the following module to the redirect application, making sure to add it after the last module in the Modules list. The following example shows the redirection module named redirect:

      1. In Wowza Streaming Engine Manager, click the redirect application in the contents panel.

      2. On the details page, click the Modules tab.

        Note: Access to the Modules tab requires an administrator user with advanced permissions. How to enable Advanced User Permissions.
      3. Click Edit and then click the Add Module button.

      4. In the Add New Module dialog box, complete the required fields:

        • Name Enter Redirect.

        • Description Additional, useful information about the module. Not used in any operations.

        • Fully Qualified Class Name Enter com.wowza.wms.plugin.loadbalancer.redirect.ClientConnections.

      5. Click Add.

      6. Click Save and then restart the application.


    XML Configuration


    Alternatively, you can add this module directly to the Redirect application's Application.xml file:

    1. In the Google Cloud Platform Console, click the Products and Services menu icon, under Compute click Compute Engine, click VM instances, and then select the load balancer server instance.

    2. At the top of the selected instance screen, click on SSH.

    3. In a text editor, edit the [install-dir]/conf/redirect/Application.xml file, and add the following module. Make sure to add it after the last Module in the <Modules> list:
                  <Module>
                      <Name>Redirect</Name>
                      <Description>Redirect</Description>
                      <Class>com.wowza.wms.plugin.loadbalancer.redirect.ClientConnections</Class>
                  </Module>
    4. Restart the Wowza Streaming Engine:
      /etc/init.d/WowzaStreamingEngine restart
    5. Close your SSH terminal window.


    More resources




    Originally Published: For Wowza Streaming Engine on 12-17-2015.

    If you're having problems or want to discuss this article, post in our forum.