rp_pool_addserver

Description

Adds a remote server name to a pool.

Noterp_pool_addserver is not currently support by mutually-aware OpenSwitch servers.

NoteYou can also use OpenSwitch Manager to add servers to a pool.

Syntax

rp_pool_addserver pool_name, server [, rel_server, status, position]

Parameters

pool_name

Name of the pool to which the server is being added.

server

Name of the remote server being added to the pool.

rel_server

Name of the server within the pool relative to the server being added.

status

The status of the server being added.

  • When status is NULL, the generic status of this server is used for all pools if it exists in the [SERVER] section of the OpenSwitch configuration file or the status can be retrieved using rp_server_status.

  • If the server does not exist in the [SERVER] section, OpenSwitch uses the status of the DEFAULT server in the [SERVER] section.

  • When status is not NULL, the value is used for the server’s effective status in this pool, regardless of the generic server status. The status value is used until you change it using rp_pool_server_status, or until the server is removed from this pool using rp_pool_remserver and re-added with status set to NULL. This is called a pool-specific server status, which facilitates pool-based failover, where individual pools fail over clients to the secondary Adaptive Server even though the primary Adaptive Server is still considered running in other pools.

    Once you set a pool’s server status using rp_pool_addserver or rp_pool_server_status, always verify the status using rp_pool_server_status, not rp_server_status, because the effective pool-specific server status can be different from the generic server status.

NotePool-specific server status and pool-based failover are not supported by mutually-aware OpenSwitch servers.

Valid status values are:

Table 7-4: Adaptive Server states

Value

Description

UP

The server is immediately available for use.

DOWN

The server is unavailable, and is not considered for new client connections to OpenSwitch.

LOCKED

The server is available, but new incoming connections being actively connected through the pool are blocked (or stopped) until the status is changed to UP or DOWN. Blocked connections appear to client applications to be “stuck” until the pool is unlocked.

position

Valid values are:

Table 7-5: Server positions

Value

Description

HEAD

rel_server is ignored, and server is placed at the beginning of the list of servers in the pool

TAIL

rel_server is ignored, and server is placed at the end of the list of servers in the pool. This is the default position if no value is supplied for position.

BEFORE

server is added immediately before rel_server in the list of servers in the pool.

AFTER

server is added immediately after rel_server in the list of servers in the pool.

Examples

Example 1

Adds server SYB_SERV1 to the end of the list of servers associated with POOL_A with no pool-specific server status.

1> rp_pool_addserver "POOL_A", "SYB_SERV1"
2> go

Example 2

Adds server SYB_SERV2 with a DOWN status to a position immediately before SYB_SERV1 in the list of servers associated with POOL_A.

1> rp_pool_addserver "POOL_A", "SYB_SERV2", "SYB_SERV1", DOWN, "BEFORE"
2> go

Example 3

Adds server SYB_SERV3 with status UP as the first server in the list of servers associated with POOL_A.

1> rp_pool_addserver "POOL_A", "SYB_SERV3", NULL, UP, "HEAD"
2> go

Example 4

Adds server SYB_SERV2 to a position immediately before SYB_SERV1 in the list of servers associated with POOL_A. The status of SYB_SERV2 is the status of the DEFAULT server.

1> rp_pool_addserver "POOL_A", "SYB_SERV2", "SYB_SERV1", NULL,"BEFORE"
2> go

Example 5

Adds server “ase3” to a position immediately before the server “ase1” in the list of servers associated with pool POOL1.

1> rp_pool_addserver "POOL1", "ase3", "ase1", NULL, "BEFORE"
2> go

Returns:

rp_pool_addserver: Server ase3 added to pool POOL1
(return status = 0)

Afterward, the rp_pool_help command is issued to display the information below about POOL1, such as status and mode (chained or balanced).

1> rp_pool_help POOL12> go

Returns:

pool_name   mode       cache      status    block       next_server
----------  --------   ---------- --------- ----------- --------------
POOL1       CHAINED    0          UP        0           ase3
(1 row affected)

server_name 
------------------------------- 
ase3
ase1
ase2
(3 rows affected)

attribute     value
------------  --------
(0 rows affected)(return status = 0)

Usage


Messages

See also

rp_pool_create, rp_pool_remattrib, rp_pool_server_status, rp_pool_remserver