From c8c63ce3539cddcfdc8248a431753e110fa37266 Mon Sep 17 00:00:00 2001 From: Tatsuo Ishii Date: Mon, 24 Jan 2011 04:36:47 +0000 Subject: [PATCH] Update English documentation. - add description of new configuration directive 'log_destination' - add description of new configuration directive 'syslog_facility' - add description of new configuration directive 'syslog_ident' - add some lines and sample to 'white_function_list' regex usage - add some lines and sample to 'black_function_list' regex usage - add information and fix output sample for the 'id' column on 'pool_nodes' command Patch provided by Gilles Darold. Also I added description for black_function_list that having lastval and currval to black_function_list is a good idea. --- doc/pgpool-en.html | 104 ++++++++++++++++++++++++++++++++------------- 1 file changed, 75 insertions(+), 29 deletions(-) diff --git a/doc/pgpool-en.html b/doc/pgpool-en.html index 9dc463bac..0a643f0d7 100644 --- a/doc/pgpool-en.html +++ b/doc/pgpool-en.html @@ -7,7 +7,7 @@ -Last modified: Sun Jan 16 19:27:59 JST 2011 +Last modified: Mon Jan 24 13:30:13 JST 2011 @@ -338,9 +338,9 @@ username:[password encrypted in md5] pg_md5 -p password: <your password> - +

or - +

 ./pg_md5 foo
 acbd18db4cc2f85cedef654fccc4a4d8
@@ -502,6 +502,31 @@ max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connection
       directory.
        

+
log_destination
+
+

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. +

+
+ +
syslog_facility
+
+

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. +

+
+ +
syslog_ident
+
+

When logging to syslog is enabled, this parameter determines the program name used to identify PgPool messages in syslog logs. The default is pgpool. +

+
pid_file_name
@@ -565,12 +590,12 @@ max_pool*num_init_children*2 <= (max_connections - superuser_reserved_connection
failover_command

- This parameter specifies a command to run when a node is detached. pgpool-II replaces the following special characters with backend specific information. +

-
+
@@ -583,7 +608,8 @@ information.
Special characterDescription
%dBackend ID of a detached node.
%POld 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. - -
+

+
@@ -615,7 +641,8 @@ information.
Special characterDescription
%dBackend ID of an attached node.
%POld 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.

- -

Generating SSL certificates

- +

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 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_.*'
+
+
black_function_list @@ -978,6 +1010,11 @@ update the database. SELECTs using functions 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 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. +

+ - +
replicate_select

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_lock
@@ -1068,9 +1113,9 @@ made:
       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 /
  • Set recovery.conf on the standby node. -A sample recovery.confcan be found +A sample recovery.conf can be found under the PostgreSQL installation directory. Its name is "share/recovery.conf.sample". Copy recovery.conf.sample as recovery.conf inside the database cluster @@ -2037,15 +2083,15 @@ benchs2=# show pool_status;

    pool_nodes

    "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