Load Balance is one of the most important features of Oracle RAC. It distributes the Load evenly to each node in the cluster to improve the overall throughput of the system. Generally, there are two methods to achieve load balancing. One is Load Balancing Based on Client connection, and the other is based on the server Listener (Listener) the collected information is used to allocate new connection requests to instances with fewer connections. This article mainly discusses Server Load balancer based on client connections and provides a demonstration.
For more information about listener configurations before Server Load balancer configuration, see
Oracle rac listener Configuration (listener. ora tnsnames. ora)
Non-Default port listening configuration in oracle rac (listener. ora tnsnames. ora)
I. Client Server Load balancer
The server Load balancer on the client is implemented by adding load_balance = yes to tnsnames. ora. Let's take a look at the explanation of oracle (Note: 226880.1 ).
The client load balancing feature enables clients to randomize connection requests among the listeners. Oracle Net progresses through the list
Protocol addresses in a random sequence, balancing the load on the varous listeners. Without client load balancing, Oracle Net progresses through
List of protocol addresses sequentially until one succeeds. This normally is referred to connect-time load balance.
As described above, if load_balance = yes is not enabled, Oracle Net selects a connection based on the address list in order until the connection is successful.
If the connection to the first host fails, in the case of multiple addresses, select the second address to connect, and so on until the connection is successful.
When load_balance = yes is enabled, Oracle Net selects a random address from multiple addresses for connection until the connection is successful.
Note: This connection method is randomly selected based on the address list, and does not take into account the number of real connections on each instance, that is, the actual connection load of each node is not considered.
Ii. server and client configurations
1. Server Listener Configuration
- Oracle @ bo2dbp: ~> More $ ORACLE_HOME/network/admin/listener. ora -- # listener on node bo2dbp
- # Listener. ora. bo2dbp Network Configuration File:/u01/oracle/db/network/admin/listener. ora. bo2dbp
- # Generated by Oracle configuration tools.
- LISTENER_NEW_BO2DBP =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = bo2dbp-vip.2gotrade.com) (PORT = 1314) (IP = FIRST ))
- (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.51) (PORT = 1314) (IP = FIRST ))
- )
- )
- ........................... -- # The rest part is omitted. Note that the configuration here uses a non-default listener Port Number of 1314.
- Oracle @ bo2dbs:/u01/oracle/db/network/admin> more listener. ora -- # listener on node bo2dbs
- # Listener. ora. bo2dbs Network Configuration File:/u01/oracle/db/network/admin/listener. ora. bo2dbs
- # Generated by Oracle configuration tools.
- LISTENER_NEW_BO2DBS =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = bo2dbs-vip.2gotrade.com) (PORT = 1314) (IP = FIRST ))
- (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.52) (PORT = 1314) (IP = FIRST ))
- )
- )
- ...............