A setup of loader balancer

Sample Load Balancer Architecture

The load balancer has a setting parameter within a system as shown in the following figures.Explanation of the setting parameter in this page is due to the following figure.


The sample file ("pglb.conf.sample") of a configuration file is created under the "etc" directory under an installation directory (default is "/usr/local/pgsql/etc") by a loader balancer's installation. Please copy this file, create the file "pglb.conf" and edit according to each environment. At the time of starting of a loader balancer, the path of this configuration file can be specified as a parameter.
$cd /usr/local/pgsql/etc
$cp [path to source]/src/pgcluster/pglb/pglb.conf.sample pglb.conf

A setup of pglb.conf

#=============================================
# pglb.conf
#---------------------------------------------
# There are two kinds of the description methods of the setup value in this file.
# One is the setting up two or more values, and another is the setting up one value at a time.
#
# <Table_Name_Tag>
# <Data_Name_Tag1> value1 </Data_Name_Tag1>
# <Data_Name_Tag2> value2 </Data_Name_Tag2>
# <Data_Name_Tag3> value3 </Data_Name_Tag3>
# </Table_Name_Tag>
# or
# <Data_Name_Tag> value </Data_Name_Tag>
#
# It is interpreted as a comment after "#"
#=============================================
#--------------------------------------------------------------------
# The setup value of Cluster DB
#--------------------------------------------------------------------
<Cluster_Server_Info>

<Host_Name> cluster_1 </Host_Name>
<Port> 5432 </Port>
<Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> cluster_2 </Host_Name>
<Port> 5432 </Port>
<Max_Connect> 30 </Max_Connect>
</Cluster_Server_Info>
<Cluster_Server_Info>
<Host_Name> cluster_3 </Host_Name>
<Port> 5432 </Port>
<Max_Connect> 30</Max_Connect>
</Cluster_Server_Info>

#--------------------------------------------------------------------
# A setup of a loader balancer
#--------------------------------------------------------------------
<Receive_Port> 5432 </Receive_Port>
<Recovery_Port> 6101 </Recovery_Port>
<LifeCheck_Port> 6201 </LifeCheck_Port>
<Max_Cluster_Num> 128 </Max_Cluster_Num>
<Use_Connection_Pooling> no </Use_Connection_Pooling>


(1)A setup of Cluster DB

・<Cluster_Server_Info>〜</Cluster_Server_Info>
A setup of Cluster DB is declared. The setup value (a host name, the port number for postmaster, the number of Maximum connection) of Cluster DB is described between a start tag and an end tag. Two or more information on Cluster DB can be set up.

・<Host_Name>〜</Host_Name>
The host name of Cluster DB describes. Please do not describe an IP address.

・<Port>〜</Port>
The port number of Cluster DB (postmaster) is described.

・<Max_Connect>〜</Max_Connect>
The maximum amount of the session linked to Cluster DB is set up. It needs to be lesser than the value of "max_connections" of Cluster DB. Cluster DB connects not only with loader balancer but with a replication server. The number which loader balancer can connect to Cluster DB becomes less than the value of "max_connections" of Cluster DB.

(2)A setup of loader balancer

・<Receive_Port>〜</Receive_Port>
The port number which receives a query from a client is described.

・<Recovery_Port>〜</Recovery_Port>
The port number which receives the recovery demand from a replication server is described.

・<LifeCheck_Port>〜</LifeCheck_Port>
The port number which receives the life check from other servers is described.

・<Max_Cluster_Num>〜</Max_Cluster_Num>
The maximum amount of Cluster DB is described. This value contains the number of the Cluster DBs to extend in the future.

・<Use_Connection_Pool>〜</Use_Connection_Pool>
It is specified whether a connection pooling function is used for connection with Cluster DB. Please describe by 'yes' or 'no'.