Configuring the Application

The load-balanced application is configured as a service in a JUNOS service set.

Multiple service sets can be configured, and multiple clusters can be configured to belong to the same service.

The service sets are consumed by configuring them on interfaces (the application supports only IPv4 interfaces).

Sample Configuration Format

The configuration for this example extends the extension-service object in the JUNOS services hierarchy. The developer writes DDL to create this extension. The DDL for the sample application configuration is in the following file in your sandbox:

sandbox/src/lib/ddl/input/equilibrium_mgmt.cnf.dd)

The configuration format, shown next, is explained after the code.

1 services {                                              ##existing:
 2     service-set service-set-name { 
 3         interface-service {
 4             service-interface ms-x/y/0.z;
 5         }
 6         extension-service load-balance-instance-name {  ##new extensions:
 7             application application-name {
 8                 application-address w.x.y.z;            ##mandatory
 9                 application-port port-number;
10                 servers {                               ##mandatory
11                     a.b.c.d;
12                     e.f.g.h;
13                 }
14                 server-monitor {
15                     server-connection-interval time-in-seconds;
16                     server-connection-timeout time-in-seconds;
17                     server-timeouts-allowed number;
18                     server-down-retry-interval time-in-seconds;
19                 }
20                 session-timeout time-in-seconds;
21             }
22         }
23     }
24 }

The configuration works as follows:

Sample Use Case

The following sample scenario configures three servers to load balance the normal traffic and four additional servers to load balance special search traffic. (The type of traffic is independent of the configuration and is given here as an example only.)

interfaces {
    fe-0/0/0 {
        unit 0 {
            family inet {
                service {
                    input {
                        service-set web-balance;
                    }
                    output {
                        service-set web-balance;
                    }
                }
                address {
                    64.252.155.1/24;
                }
            }
        }
    }
}
services {
    service-set web-balance { 
        interface-service {
            service-interface ms-1/2/0.0;
        }
        extension-service load-balance-my-http {
            application www {
                application-address 64.252.155.10;
                servers {
                    64.252.155.3;
                    64.252.155.4;
                    64.252.155.5;
                }
                server-monitor;
            }
            application www-search {
                application-address 64.252.155.11;
                servers {
                    64.252.155.6;
                    64.252.155.7;
                    64.252.155.8;
                    64.252.155.9;
                }
                server-monitor {
                    server-connection-interval 300;
                    server-timeouts-allowed 0;
                    server-down-retry 60;
                }
                session-timeout 600;
            }
        }
    }
}

In this configuration, the application name www is used to configure an object with three servers. Monitoring is enabled with all the defaults, and the default application port of 80 and default session timeout of 15 minutes are used.

The www-search application (an example of a meaningful application name) has a specific IP address, as well as four different servers. Requests using the search servers specify this address or a name that resolves to it. The port number used is still 80, but here we see a custom session timeout of 600 (10 minutes). There is some customization of the monitor in three of the four optional attributes.

Some necessary configuration is not shown. Specifically, the configuration of the logical interface that is used as the service-interface in the service set (ms-1/2/0.0 here) needs to include a routable address for use when probing servers. Additionally, the chassis configuration of the data and control cores should leave at least one user core and one data core. However, it is recommended to have six data cores (as many as possible while leaving one user core). If no user cores are available, the extra non-data threads remain bound to control cores.

You must also configure the object cache so it is available to the data component for fast memory access and allocation.

The standard JUNOS trace options are configured separately under sync equilibrium.

Limitations of Current Support

The following limits apply to service set configurations in general and to this application in particular:

Processing the Configuration
© 2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:47 2010 for Juniper Networks Partner Solution Development Platform JUNOS SDK 10.2R1 by Doxygen 1.4.5