head	1.5;
access;
symbols;
locks; strict;
comment	@# @;


1.5
date	2001.08.01.01.27.19;	author dlr;	state Exp;
branches;
next	1.4;

1.4
date	2001.04.14.07.54.08;	author dlr;	state Exp;
branches;
next	1.3;

1.3
date	2001.04.13.22.32.13;	author dlr;	state Exp;
branches;
next	1.2;

1.2
date	2001.04.13.19.45.11;	author dlr;	state Exp;
branches;
next	1.1;

1.1
date	2001.04.13.17.53.11;	author dlr;	state Exp;
branches;
next	;


desc
@@


1.5
log
@Corrected usage mis-capitalization.
@
text
@#!/usr/bin/perl -w
# Creates all JServ clustering configuration except servlet zone.
# usage: jserv_load_balance_config <sandbox> <use standard ports> [host list]

BEGIN
{
    my $SANDBOX = shift(@@ARGV);
    unshift(@@INC, "$SANDBOX/scripts");
}
use TigrisConfig;

my %PORTS = TigrisConfig::get_ports(shift(@@ARGV));
my @@HOSTS = @@ARGV;

my $NBR_HOSTS = scalar(@@HOSTS);

if ($NBR_HOSTS > 0)
{
    print << 'EOT';
# JVM cluster hosts and their weights.  Higher values correspond to higher
# weights.
EOT

        for (my $hostNbr = 1; $hostNbr <= $NBR_HOSTS; $hostNbr++)
        {
            print "ApJServBalance cluster CH$hostNbr 1\n";
        }

    print << 'EOT';

# Cluster hosts and routing identifiers.  Each defined host corresponds to a
# routing token used as an identifier in future requests for direction of
# traffic.
EOT

        my $hostNbr = 1;
    for my $host (@@HOSTS)
        {
            print "ApJServHost CH$hostNbr ajpv12://$host:$PORTS{JSERV_PORT}\n";
            $hostNbr++;
        }

    print "\n";

    for (my $hostNbr = 1; $hostNbr <= $NBR_HOSTS; $hostNbr++)
    {
        print "ApJServRoute JS$hostNbr CH$hostNbr\n";
    }
}
@


1.4
log
@EOT needed to be flush with start of line.
@
text
@d3 1
a3 1
# usage: jserv_load_balance_Config <sandbox> <use standard ports> [host list]
@


1.3
log
@Only generate output when called with a host list.
@
text
@d22 1
a22 1
    EOT
d34 1
a34 1
    EOT
@


1.2
log
@Updated for args and proper @@INC.
@
text
@d15 5
a19 1
print << 'EOT';
d22 1
a22 3
EOT

my $NBR_HOSTS = scalar(@@HOSTS);
d24 4
a27 4
for (my $hostNbr = 1; $hostNbr <= $NBR_HOSTS; $hostNbr++)
{
    print "ApJServBalance cluster CH$hostNbr 1\n";
}
d29 1
a29 1
print << 'EOT';
d34 1
a34 8
EOT

my $hostNbr = 1;
for my $host (@@HOSTS)
{
    print "ApJServHost CH$hostNbr ajpv12://$host:$PORTS{JSERV_PORT}\n";
    $hostNbr++;
}
d36 13
a48 5
print "\n";

for (my $hostNbr = 1; $hostNbr <= $NBR_HOSTS; $hostNbr++)
{
    print "ApJServRoute JS$hostNbr CH$hostNbr\n";
@


1.1
log
@The jserv_load_balance_config script cannot be a .in file because it is called from env.sh.
@
text
@d3 1
d5 5
a9 1
BEGIN { unshift(@@INC, "$ENV{SANDBOX}/scripts"); }
d12 1
a13 1
my %PORTS = TigrisConfig::get_ports();
@

