2
# pgpool-II configuration file sample for Stream replication/Hot standby.
3
# $Header: /cvsroot/pgpool/pgpool-II/pgpool.conf.sample-stream,v 1.5.2.3 2011/05/11 01:57:13 t-ishii Exp $
5
# Host name or IP address to listen on: '*' for all, '' for no TCP/IP
7
listen_addresses = 'localhost'
9
# Port number for pgpool
12
# Port number for pgpool communication manager
15
# Unix domain socket path. (The Debian package defaults to
16
# /var/run/postgresql.)
17
socket_dir = '/var/run/postgresql'
19
# Unix domain socket path for pgpool communication manager.
20
# (Debian package defaults to /var/run/postgresql)
21
pcp_socket_dir = '/var/run/postgresql'
23
# Unix domain socket path for the backend. Debian package defaults to /var/run/postgresql!
24
backend_socket_dir = '/var/run/postgresql'
26
# pgpool communication manager timeout. 0 means no timeout. This parameter is ignored now.
29
# number of pre-forked child process
30
num_init_children = 32
32
# Number of connection pools allowed for a child process
35
# If idle for this many seconds, child exits. 0 means no timeout.
38
# If idle for this many seconds, connection to PostgreSQL closes.
40
connection_life_time = 0
42
# If child_max_connections connections were received, child exits.
44
child_max_connections = 0
46
# If client_idle_limit is n (n > 0), the client is forced to be
47
# disconnected whenever after n seconds idle (even inside an explicit
49
# 0 means no disconnect.
52
# Maximum time in seconds to complete client authentication.
54
authentication_timeout = 60
57
logdir = '/var/log/postgresql'
60
pid_file_name = '/var/run/postgresql/pgpool.pid'
63
replication_mode = false
65
# Load balancing mode, i.e., all SELECTs are load balanced.
66
load_balance_mode = true
68
# If there's a disagreement with the packet kind sent from backend,
69
# then degenrate the node which is most likely "minority". If false,
70
# just force to exit this session.
71
replication_stop_on_mismatch = false
73
# If there's a disagreement with the number of affected tuples in
74
# UPDATE/DELETE, then degenrate the node which is most likely
76
# If false, just abort the transaction to keep the consistency.
77
failover_if_affected_tuples_mismatch = false
79
# If true, replicate SELECT statement when replication_mode or parallel_mode is enabled.
80
# A priority of replicate_select is higher than load_balance_mode.
81
replicate_select = false
83
# Semicolon separated list of queries to be issued at the end of a
85
reset_query_list = 'ABORT; DISCARD ALL'
86
# for 8.2 or older this should be as follows.
87
#reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
89
# white_function_list is a comma separated list of function names
90
# those do not write to database. Any functions not listed here
91
# are regarded to write to database and SELECTs including such
92
# writer-functions will be executed on master(primary) in master/slave
93
# mode, or executed on all DB nodes in replication mode.
95
# black_function_list is a comma separated list of function names
96
# those write to database. Any functions not listed here
97
# are regarded not to write to database and SELECTs including such
98
# read-only-functions will be executed on any DB nodes.
100
# You cannot make full both white_function_list and
101
# black_function_list at the same time. If you specify something in
102
# one of them, you should make empty other.
104
# Pre 3.0 pgpool-II recognizes nextval and setval in hard coded
105
# way. Following setting will do the same as the previous version.
106
# white_function_list = ''
107
# black_function_list = 'nextval,setval'
108
white_function_list = ''
109
black_function_list = 'currval,lastval,nextval,setval'
111
# If true print timestamp on each log line.
112
print_timestamp = true
114
# If true, operate in master/slave mode.
115
master_slave_mode = true
117
# Master/slave sub mode. either 'slony' or 'stream'. Default is 'slony'.
118
master_slave_sub_mode = 'stream'
120
# If the standby server delays more than delay_threshold,
121
# any query goes to the primary only. The unit is in bytes.
122
# 0 disables the check. Default is 0.
123
# Note that health_check_period required to be greater than 0
124
# to enable the functionality.
125
delay_threshold = 10000000
127
# 'always' logs the standby delay whenever health check runs.
128
# 'if_over_threshold' logs only if the delay exceeds delay_threshold.
129
# 'none' disables the delay log.
130
log_standby_delay = 'if_over_threshold'
132
# If true, cache connection pool.
133
connection_cache = true
135
# Health check timeout. 0 means no timeout.
136
health_check_timeout = 20
138
# Health check period. 0 means no health check.
139
health_check_period = 0
142
health_check_user = 'nobody'
144
# Execute command by failover.
145
# special values: %d = node id
148
# %D = database cluster path
149
# %m = new master node id
150
# %H = hostname of the new master node
151
# %M = old master node id
152
# %P = old primary node id
155
failover_command = ''
157
# Execute command by failback.
158
# special values: %d = node id
161
# %D = database cluster path
162
# %m = new master node id
163
# %H = hostname of the new master node
164
# %M = old master node id
165
# %P = old primary node id
168
failback_command = ''
170
# If true, trigger fail over when writing to the backend communication
171
# socket fails. This is the same behavior of pgpool-II 2.2.x or
172
# earlier. If set to false, pgpool will report an error and disconnect
174
fail_over_on_backend_error = true
176
# If true, automatically locks a table with INSERT statements to keep
177
# SERIAL data consistency. If the data does not have SERIAL data
178
# type, no lock will be issued. An /*INSERT LOCK*/ comment has the
179
# same effect. A /*NO INSERT LOCK*/ comment disables the effect.
182
# If true, ignore leading white spaces of each query while pgpool judges
183
# whether the query is a SELECT so that it can be load balanced. This
184
# is useful for certain APIs such as DBI/DBD which is known to adding an
185
# extra leading white space.
186
ignore_leading_white_space = true
188
# If true, print all statements to the log. Like the log_statement option
189
# to PostgreSQL, this allows for observing queries without engaging in full
191
log_statement = false
193
# If true, print all statements to the log. Similar to log_statement except
194
# that prints DB node id and backend process id info.
195
log_per_node_statement = false
197
# If true, incoming connections will be printed to the log.
198
log_connections = false
200
# If true, hostname will be shown in ps status. Also shown in
201
# connection log if log_connections = true.
202
# Be warned that this feature will add overhead to look up hostname.
205
# if non 0, run in parallel query mode
206
parallel_mode = false
208
# if non 0, use query cache
209
enable_query_cache = false
211
#set pgpool2 hostname
212
pgpool2_hostname = ''
215
system_db_hostname = 'localhost'
216
system_db_port = 5432
217
system_db_dbname = 'pgpool'
218
system_db_schema = 'pgpool_catalog'
219
system_db_user = 'pgpool'
220
system_db_password = ''
222
# backend_hostname, backend_port, backend_weight
224
backend_hostname0 = 'host1'
227
backend_data_directory0 = '/data'
228
backend_hostname1 = 'host2'
231
backend_data_directory1 = '/data1'
235
# If true, use pool_hba.conf for client authentication.
236
enable_pool_hba = false
238
# - online recovery -
239
# online recovery user
240
recovery_user = 'nobody'
242
# online recovery password
243
recovery_password = ''
245
# execute a command in first stage.
246
recovery_1st_stage_command = ''
248
# execute a command in second stage.
249
recovery_2nd_stage_command = ''
251
# maximum time in seconds to wait for the recovering node's postmaster
252
# start-up. 0 means no wait.
253
# this is also used as a timer waiting for clients disconnected before
255
recovery_timeout = 90
257
# If client_idle_limit_in_recovery is n (n > 0), the client is forced
258
# to be disconnected whenever after n seconds idle (even inside an
259
# explicit transactions!) in the second stage of online recovery.
260
# n = -1 forces clients to be disconnected immediately.
261
# 0 disables this functionality(wait forever).
262
# This parameter only takes effect in recovery 2nd stage.
263
client_idle_limit_in_recovery = 0
265
# Specify table name to lock. This is used when rewriting lo_creat
266
# command in replication mode. The table must exist and has writable
267
# permission to public. If the table name is '', no rewriting occurs.
270
# If true, enable SSL support for both frontend and backend connections.
271
# note that you must also set ssl_key and ssl_cert for SSL to work in
272
# the frontend connections.
274
# path to the SSL private key file
275
#ssl_key = './server.key'
276
# path to the SSL public certificate file
277
#ssl_cert = './server.cert'
279
# If either ssl_ca_cert or ssl_ca_cert_dir is set, then certificate
280
# verification will be performed to establish the authenticity of the
281
# certificate. If neither is set to a nonempty string then no such
282
# verification takes place. ssl_ca_cert should be a path to a single
283
# PEM format file containing CA root certificate(s), whereas ssl_ca_cert_dir
284
# should be a directory containing such files. These are analagous to the
285
# -CAfile and -CApath options to openssl verify(1), respectively.
287
#ssl_ca_cert_dir = ''
289
# Debug message verbosity level. 0: no message, 1 <= : more verbose