From c8c63ce3539cddcfdc8248a431753e110fa37266 Mon Sep 17 00:00:00 2001
From: Tatsuo Ishii
or
-
+
./pg_md5 foo
acbd18db4cc2f85cedef654fccc4a4d8
@@ -502,6 +502,31 @@ max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connection
directory.
PgPool II supports several methods for logging server messages, + including stderr and syslog. The default is to log to stderr. +
+Note: you will need to alter the configuration of your system's syslog daemon in order to make use of the syslog option for log_destination. PgPool can log to syslog facilities LOCAL0 through LOCAL7 (see syslog_facility), but the default syslog configuration on most platforms will discard all such messages. You will need to add something like +
++ local0.* /var/log/pgpool.log ++
to the syslog daemon's configuration file to make it work. +
+When logging to syslog is enabled, this parameter determines the syslog "facility" to be used. You can choose from LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7; the default is LOCAL0. See also the documentation of your system's syslog daemon. +
+When logging to syslog is enabled, this parameter determines the program name used to identify PgPool messages in syslog logs. The default is pgpool. +
+- This parameter specifies a command to run when a node is detached. pgpool-II replaces the following special characters with backend specific information. +
--
Special character Description @@ -583,7 +608,8 @@ information. %d Backend ID of a detached node. %P Old primary node ID. %% '%' character
You need to reload pgpool.conf if you change failover_command.
@@ -601,8 +627,8 @@ connections from clients. This parameter specifies a command to run when a node is attached. pgpool-II replaces special the following characters with backend specific information. - --
Special character Description @@ -615,7 +641,8 @@ information. %d Backend ID of an attached node. %P Old primary node ID. %% '%' character
You need to reload pgpool.conf if you change failback_command.
@@ -828,19 +855,18 @@ postmaster. You need to reload pgpool.conf if you change this value. For this purpose, relcache_expiration controls the life time of the cache.Certificate handling is outside the scope of this document. The Secure TCP/IP Connections with SSL page at postgresql.org has pointers with sample commands for how to generate self-signed certificates. +
-Failover in the raw Mode
+Failover can be performed in raw mode if multiple servers are defined. pgpool-II usually accesses the backend specified by @@ -968,6 +994,12 @@ update the database. SELECTs using functions not specified in this list are neither load balanced, nor replicated if in replication mode. In master slave mode, such SELECTs are sent to master (primary) only.
+You can use regular expression into the list to match function name, for example if you have prefixed all your read only function with 'get_' or 'select_' +
++white_function_list = 'get_.*,select_.*' ++
You can use regular expression into the list to match function name, for example if you have prefixed all your updating functions with 'set_', 'update_', 'delete_' or 'insert_': +
++black_function_list = 'nextval,setval,set_.*,update_.*,delete_.*,insert_.*' +
Only one of these two lists can be filled in a configuration.
@@ -986,17 +1023,24 @@ Prior to pgpool-II 3.0, nextval() and setval() were known to do writes to the database. You can emulate this by using white_function_list and black_function_list: +
white_function_list = '' -black_function_list = 'nextval,setval' +black_function_list = 'nextval,setval,lastval,currval'+ +
+Please notice that we have lastval, currval in addition to nextval and setval. +Though lastval() and currval() are not writing functions, it is wise to add lastval() and currval() to avoid errors in the case when these functions are accidentaly load balanced to other DB node. +Adding to black_function_list will prevent load balancing. +
+ - +When set to true, pgpool-II replicates SELECTs in replication mode. If false, pgpool-II only sends them to the Master DB. Default is false.
-If a SELECT query is inside an explicit transaction block, replicate_select and @@ -1056,6 +1100,7 @@ Details are shown below.
+
INSERT INTO ...
-
+ to - +
BEGIN;
LOCK TABLE ...
@@ -1078,14 +1123,15 @@ made:
COMMIT;
- When insert_lock is true, pgpool-II
+ When insert_lock is true, pgpool-II
automatically adds the above queries each time an INSERT is
executed (if already in transaction, it simply adds LOCK TABLE
....).
-
- As of pgpool-II 2.2, it automatically detects if the table has a
+
As of pgpool-II 2.2, it automatically detects if the table has a SERIAL columns or not, so only tables having SERIAL columns are locked. +
pgpool-II 3.0 or later uses a row lock against the sequence relation, rather than table lock. This will minimize lock @@ -1111,14 +1157,14 @@ made: the regression tests for PostgreSQL 8.0 will fail in transactions, privileges, rules, and alter_table. The reason for this is that pgpool-II tries to LOCK the VIEW for the rule test, and will - produce the following error message: + produce the following error message:
! ERROR: current transaction is aborted, commands ignored until
end of transaction block
- For example, the transactions test tries an INSERT into a table
+ For example, the transactions test tries an INSERT into a table which does not exist, and pgpool-II causes PostgreSQL to acquire the lock before that. The transaction will be aborted, and the following INSERT statement produces the above error message.
@@ -1451,7 +1497,7 @@ failover_command = '/usr/local/src/pgsql/9.0-beta/bin/failover_stream.sh %d %H /"SHOW pool_nodes" sends back a list of all configured nodes. It -displays the hostname, the port, the status, and the weight (only meaningful +displays the node id, the hostname, the port, the status, and the weight (only meaningful if you use the load balancing mode). The possible values in the status column are explained in the pcp_node_info reference.
benchs2=# show pool_nodes; - hostname | port | status | lb_weight --------------+------+--------+----------- - 127.0.0.1 | 5432 | 2 | 0.5 - 192.168.1.7 | 5432 | 3 | 0.5 + id | hostname | port | status | lb_weight +------+-------------+------+--------+----------- + 0 | 127.0.0.1 | 5432 | 2 | 0.5 + 1 | 192.168.1.7 | 5432 | 3 | 0.5 (2 lignes)-- 2.39.5