7.7 pgpool-II

Table of Contents Previous Next



The pgpool-II service script is named ppas-pgpool. The service script resides in the /etc/init.d directory. You can control the pgpool-II service, or check the status of the service with the following command:
Where action specifies:
start to start the service.
stop to stop the service
restart to stop and then start the service.
status to return the status of the service.
When pgpool-II starts, it records its process ID in a file whose name is determined by the pid_file_name configuration parameter. The initial value of the pid_file_name parameter in the sample file is:
Please note that the contents of the /var/run directory (including the pgpool directory) may be removed by the operating system during a reboot. The /var/run/pgpool directory should NOT be used as the location for the pgpool.pid file.
Modify the pid_file_name parameter to specify a safer directory location. For example:
The /var/run directory will persist after a system reboot, and if removed by the operating system, the pgpool.pid file will be recreated by pgpool-II upon startup.
1.
Configure the pg_hba.conf file on the pgpool host to permit connections between the clients and the server.
2.
Copy the pgpool.conf.sample file to pgpool.conf, and modify the file, setting the connection_cache parameter to on, and specifying connection properties for your database server.
Note that in the pgpool.conf file, connection parameters have an appended digit that specifies a cluster node identifier. Database node 0 specifies values for the master node.
The following table lists pgpool.conf parameters that are used when implementing connection pooling:
Host name or IP address for backend 0. You can specify '' if the backend and pgpool-II are running on the same host.
Weight for backend 0 (only in load balancing mode). Specify 1 for each backend if you want the load equally balanced, or decimal values (.9, .1, etc.) to weight the load towards certain backends.
Set to on to use pool_hba conf for client authentication.
Set to on to enable connection pooling.
The following table lists pgpool.conf parameters that are used when implementing replication and load balancing:
Set to on to activate load balancing mode. If load_balance_mode is on そして replicate_select is off, SELECT statements are sent to one backend. The proportion of SELECT statements each backend receives is determined by parameter backend_weight<N>.
ignore_leading_white_space
Ignore leading white spaces of each query. Certain APIs such as DBI/DBD::Pg for Perl add white space that the user cannot control. Default is on
pgpool-II authentication properties are determined by parameter settings in the pool_hba.conf configuration file. The pool_hba.conf file is similar in format and function to the Postgres pg_hba.conf configuration file. Please consult the pgpool-II documentation for detailed information about pool_hba.conf entries.
1.
Copy file pool_hba.conf.sample to pool_hba.conf.
2.
Modify the pool_hba.conf file, specifying authentication information for servers or users that you wish to allow to connect. Entries follow the same format used in the pg_hba.conf file.
3.
Modify the pgpool.conf file, setting the enable_pool_hba parameter to on.
Note: user names and passwords specified in the pool_hba.conf file will be used for authentication with the database server; you must also specify those user names and passwords in the database server's pg_hba.conf file.
When invoked at the psql prompt, the following SHOW command keywords will display pgpool-II information:
Before using PCP commands, you must modify the pcp.conf file, providing user names and passwords that you supply whenever you issue a PCP command. The user names in the pcp.conf file are completely independent of the database server user names and passwords.
1.
Copy the pcp.conf.sample file to pcp.conf.
username is a PCP user name.
md5_password is the PCP password in md5 format
You can use the pg_md5 program to generate the encrypted password from the clear-text form as shown below:
For example, the entry in the pcp.conf file for a PCP user named pcpuser with the password of mypassword is:
pcp_node_count timeout host port username password
pcp_node_info timeout host port username password nodeid
pcp_proc_count timeout host port username password
pcp_proc_info timeout host port username password processid
pcp_detach_node [-g] timeout host port username password nodeid
Detaches the node specified by <nodeid> from pgpool-II. If -g is given, wait until all clients are disconnected (unless client_idle_limit_in_recovery is -1 or recovery_timeout is expired).
pcp_attach_node timeout host port username password nodeid


Table of Contents Previous Next