ALTER LOAD BALANCE GROUP

Changes the configuration of a load balance group.

Syntax

ALTER LOAD BALANCE GROUP group-name {
    RENAME TO new-name
    | SET FILTER TO 'ip-cidr-addr'
    | SET POLICY TO 'policy'
    | ADD {ADDRESS | FAULT GROUP} add-list
    | DROP  {ADDRESS | FAULT GROUP} drop-list  
}

Parameters

group_name Name of an existing load balance group to change.
RENAME TO new-name Renames the group to new-name.
SET FILTER TO 'ip-cidr-addr' Changes the IP address filter that selects which members of a fault group or groups are included in the load balance group. This setting is only valid if the load balance group contains fault groups.
SET POLICY TO 'policy'

Changes the policy the load balance group uses to select the target node for the incoming connection. One of:

  • ROUNDROBIN
  • RANDOM
  • NONE

See CREATE LOAD BALANCE GROUP for details.

ADD {ADDRESS | FAULT GROUP} Adds objects of the specified type to the load balance group. Load balance groups can only contain one type of object. For example, if you created the load balance group using a list of addresses, you can only add additional addresses.
add-list A comma-delimited list of objects (addresses or fault groups) to add to the fault group.
DROP {ADDRESS | FAULT GROUP} Removes objects of the specified type from the load balance group (addresses or fault groups). The object type must match the type of the objects already in the load balance group.
drop-list The list of objects to remove from the load balance group.

Privileges

Superuser

Example

Remove an address from the load balance group named group_2.

=> SELECT * FROM LOAD_BALANCE_GROUPS;
  name   |   policy   | filter |         type          | object_name
---------+------------+--------+-----------------------+-------------
 group_1 | ROUNDROBIN |        | Network Address Group | node01
 group_1 | ROUNDROBIN |        | Network Address Group | node02
 group_2 | ROUNDROBIN |        | Network Address Group | node03
(3 rows)

=> ALTER LOAD BALANCE GROUP group_2 DROP ADDRESS node03;
ALTER LOAD BALANCE GROUP

=> SELECT * FROM LOAD_BALANCE_GROUPS;
  name   |   policy   | filter |         type          | object_name
---------+------------+--------+-----------------------+-------------
 group_1 | ROUNDROBIN |        | Network Address Group | node01
 group_1 | ROUNDROBIN |        | Network Address Group | node02
 group_2 | ROUNDROBIN |        | Empty Group           |
(3 rows)

The following example adds three network addresses to the group named group_2:

=> ALTER LOAD BALANCE GROUP group_2 ADD ADDRESS node01,node02,node03;
ALTER LOAD BALANCE GROUP
=> SELECT * FROM load_balance_groups WHERE name = 'group_2';
-[ RECORD 1 ]----------------------
name        | group_2
policy      | ROUNDROBIN
filter      | 
type        | Network Address Group
object_name | node01
-[ RECORD 2 ]----------------------
name        | group_2
policy      | ROUNDROBIN
filter      | 
type        | Network Address Group
object_name | node02
-[ RECORD 3 ]----------------------
name        | group_2
policy      | ROUNDROBIN
filter      | 
type        | Network Address Group
object_name | node03

See Also