Enabling and Disabling Native Connection Load Balancing

Only a database superuser can enable or disable native connection load balancing. To enable or disable load balancing, use the SET_LOAD_BALANCE_POLICY function to set the load balance policy. Setting the load balance policy to anything other than 'NONE' enables load balancing on the server. The following example enables native connection load balancing by setting the load balancing policy to ROUNDROBIN.

=> SELECT SET_LOAD_BALANCE_POLICY('ROUNDROBIN');
                  SET_LOAD_BALANCE_POLICY
--------------------------------------------------------------------------------
Successfully changed the client initiator load balancing policy to: roundrobin
(1 row)

To disable native connection load balancing, use SET_LOAD_BALANCE_POLICY to set the policy to 'NONE':

=> SELECT SET_LOAD_BALANCE_POLICY('NONE');
SET_LOAD_BALANCE_POLICY
--------------------------------------------------------------------------
Successfully changed the client initiator load balancing policy to: none
(1 row)

Note: When a client makes a connection, the native load-balancer chooses a node and returns the value from the export_address column in the NODES table. The client then uses the export_address to connect. The node_address specifies the address to use for inter-node and spread communications. When a database is installed, the export_address and node_address are set to the same value. If you installed HP Vertica on a private address, then you must set the export_address to a public address for each node.

By default, client connections are not load balanced, even when connection load balancing is enabled on the server. Clients must set a connection parameter to indicates they are willing to have their connection request load balanced. See Enabling Native Connection Load Balancing in ADO.NET, Enabling Native Connection Load Balancing in JDBC and Enabling Native Connection Load Balancing in ODBC in the Connecting to HP Vertica Guide for more information.

Important: In mixed IPv4 and IPv6 environments, balancing only works for the address family for which you have configured load balancing. For example, if you have configured load balancing using an IPv4 address, then IPv6 clients cannot use load balancing, however the IPv6 clients can still connect, but load balancing does not occur.

Resetting the Load Balancing State

When the load balancing policy is ROUNDROBIN, each host in the HP Vertica cluster maintains its own state of which host it will select to handle the next client connection. You can reset this state to its initial value (usually, the host with the lowest-node id) using the RESET_LOAD_BALANCE_POLICY function:

=> SELECT RESET_LOAD_BALANCE_POLICY();
RESET_LOAD_BALANCE_POLICY
-------------------------------------------------------------------------
Successfully reset stateful client load balance policies: "roundrobin".
(1 row)

Related Information

About Native Connection Load Balancing

Related Tasks

Monitoring Native Connection Load Balancing

Enabling Native Connection Load Balancing in ODBC

Enabling Native Connection Load Balancing in JDBC

Enabling Native Connection Load Balancing in ADO.NET

Reference Materials

RESET_LOAD_BALANCE_POLICY

SET_LOAD_BALANCE_POLICY

JDBC Connection Properties

Data Source Name (DSN) Connection Parameters


Was this topic helpful?

© 2006 - 2015 Hewlett-Packard Development Company, L.P.