1 # ----------------------------
2 # pgPool-II configuration file
3 # ----------------------------
5 # This file consists of lines of the form:
9 # Whitespace may be used. Comments are introduced with "#" anywhere on a line.
10 # The complete list of parameter names and allowed values can be found in the
11 # pgPool-II documentation.
13 # This file is read on server startup and when the server receives a SIGHUP
14 # signal. If you edit the file on a running system, you have to SIGHUP the
15 # server for the changes to take effect, or use "pgpool reload". Some
16 # parameters, which are marked below, require a server shutdown and restart to
21 #------------------------------------------------------------------------------
23 #------------------------------------------------------------------------------
25 # - pgpool Connection Settings -
27 listen_addresses = '*'
28 # Host name or IP address to listen on:
29 # '*' for all, '' for no TCP/IP connections
30 # (change requires restart)
33 # (change requires restart)
34 socket_dir = '/var/run/postgresql'
35 # Unix domain socket path
36 # The Debian package defaults to
38 # (change requires restart)
41 # - pgpool Communication Manager Connection Settings -
45 # (change requires restart)
46 pcp_socket_dir = '/var/run/postgresql'
47 # Unix domain socket path for pcp
48 # The Debian package defaults to
50 # (change requires restart)
52 # - Backend Connection Settings -
54 #backend_hostname0 = 'host1'
55 # Host name or IP address to connect to for backend 0
57 # Port number for backend 0
59 # Weight for backend 0 (only in load balancing mode)
60 #backend_data_directory0 = '/data'
61 # Data directory for backend 0
62 #backend_flag0 = 'ALLOW_TO_FAILOVER'
63 # Controls various backend behavior
64 # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
65 backend_hostname0='master.foo.bar'
68 backend_data_directory0 = '/var/lib/postgres/9.1/main/'
69 backend_flag0 = 'ALLOW_TO_FAILOVER'
71 backend_hostname1='slave.foo.bar'
74 backend_data_directory1 = '/var/lib/postgres/9.1/main/'
75 backend_flag1 = 'ALLOW_TO_FAILOVER'
81 # Use pool_hba.conf for client authentication
82 authentication_timeout = 60
83 # Delay in seconds to complete client authentication
90 # (change requires restart)
91 #ssl_key = './server.key'
92 # Path to the SSL private key file
93 # (change requires restart)
94 #ssl_cert = './server.cert'
95 # Path to the SSL public certificate file
96 # (change requires restart)
98 # Path to a single PEM format file
99 # containing CA root certificate(s)
100 # (change requires restart)
101 #ssl_ca_cert_dir = ''
102 # Directory containing CA root certificate(s)
103 # (change requires restart)
106 #------------------------------------------------------------------------------
108 #------------------------------------------------------------------------------
112 num_init_children = 32
114 # (change requires restart)
116 # Number of connections per pool
117 # (change requires restart)
121 child_life_time = 300
122 # Pool exits after being idle for this many seconds
123 child_max_connections = 100
124 # Pool exits after receiving that many connections
126 connection_life_time = 0
127 # Connection to backend closes after being idle for this many seconds
129 client_idle_limit = 120
130 # Client is disconnected after being idle for that many seconds
131 # (even inside an explicit transactions!)
132 # 0 means no disconnection
135 #------------------------------------------------------------------------------
137 #------------------------------------------------------------------------------
141 log_destination = 'stderr'
143 # Valid values are combinations of stderr,
144 # and syslog. Default to stderr.
149 # Print timestamp on each line
150 # (change requires restart)
155 # Hostname will be shown in ps status
156 # and in logs if connections are logged
159 log_per_node_statement = off
161 # with node and backend informations
162 log_standby_delay = 'none'
164 # Valid values are combinations of always,
165 # if_over_threshold, none
167 # - Syslog specific -
169 syslog_facility = 'LOCAL0'
170 # Syslog local facility. Default to LOCAL0
171 syslog_ident = 'pgpool'
172 # Syslog program identification string
173 # Default to 'pgpool'
178 # Debug message verbosity level
179 # 0 means no message, 1 or more mean verbose
182 #------------------------------------------------------------------------------
184 #------------------------------------------------------------------------------
186 pid_file_name = '/var/run/postgresql/pgpool.pid'
188 # (change requires restart)
189 logdir = '/var/log/postgresql'
190 # Directory of pgPool status file
191 # (change requires restart)
194 #------------------------------------------------------------------------------
196 #------------------------------------------------------------------------------
198 connection_cache = on
199 # Activate connection pools
200 # (change requires restart)
202 # Semicolon separated list of queries
203 # to be issued at the end of a session
204 # The default is for 8.3 and later
205 reset_query_list = 'ABORT; DISCARD ALL'
206 # The following one is for 8.2 and before
207 #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
210 #------------------------------------------------------------------------------
212 #------------------------------------------------------------------------------
214 replication_mode = off
215 # Activate replication mode
216 # (change requires restart)
217 replicate_select = off
218 # Replicate SELECT statements
219 # when in replication or parallel mode
220 # replicate_select is higher priority than
224 # Automatically locks a dummy row or a table
225 # with INSERT statements to keep SERIAL data
227 # Without SERIAL, no lock will be issued
229 # When rewriting lo_creat command in
230 # replication mode, specify table name to
233 # - Degenerate handling -
235 replication_stop_on_mismatch = off
236 # On disagreement with the packet kind
237 # sent from backend, degenerate the node
238 # which is most likely "minority"
239 # If off, just force to exit this session
241 failover_if_affected_tuples_mismatch = off
242 # On disagreement with the number of affected
243 # tuples in UPDATE/DELETE queries, then
244 # degenerate the node which is most likely
246 # If off, just abort the transaction to
247 # keep the consistency
250 #------------------------------------------------------------------------------
251 # LOAD BALANCING MODE
252 #------------------------------------------------------------------------------
254 load_balance_mode = on
255 # Activate load balancing mode
256 # (change requires restart)
257 ignore_leading_white_space = on
258 # Ignore leading white spaces of each query
259 white_function_list = ''
260 # Comma separated list of function names
261 # that don't write to database
262 # Regexp are accepted
263 black_function_list = 'currval,lastval,nextval,setval,sp_.*'
264 # Comma separated list of function names
265 # that write to database
266 # Regexp are accepted
269 #------------------------------------------------------------------------------
271 #------------------------------------------------------------------------------
273 master_slave_mode = on
274 # Activate master/slave mode
275 # (change requires restart)
276 master_slave_sub_mode = 'stream'
277 # Master/slave sub mode
278 # Valid values are combinations slony or
279 # stream. Default is slony.
280 # (change requires restart)
285 # Streaming replication check period
286 # Disabled (0) by default
287 sr_check_user = 'postgres'
288 # Streaming replication check user
289 # This is necessary even if you disable
290 # streaming replication delay check with
291 # sr_check_period = 0
292 sr_check_password = 'nopass'
293 # Password for streaming replication check user
295 # Threshold before not dispatching query to standby node
297 # Disabled (0) by default
299 # - Special commands -
301 follow_master_command = 'echo %M > /tmp/postgres_master'
302 # Executes this command after master failover
307 # %D = database cluster path
308 # %m = new master node id
309 # %H = hostname of the new master node
310 # %M = old master node id
311 # %P = old primary node id
315 #------------------------------------------------------------------------------
316 # PARALLEL MODE AND QUERY CACHE
317 #------------------------------------------------------------------------------
320 # Activates parallel query mode
321 # (change requires restart)
322 enable_query_cache = off
323 # Activates query cache
324 # (change requires restart)
326 pgpool2_hostname = ''
327 # Set pgpool2 hostname
328 # (change requires restart)
332 system_db_hostname = 'localhost'
333 # (change requires restart)
334 system_db_port = 5432
335 # (change requires restart)
336 system_db_dbname = 'pgpool'
337 # (change requires restart)
338 system_db_schema = 'pgpool_catalog'
339 # (change requires restart)
340 system_db_user = 'pgpool'
341 # (change requires restart)
342 system_db_password = ''
343 # (change requires restart)
346 #------------------------------------------------------------------------------
348 #------------------------------------------------------------------------------
350 health_check_period = 30
351 # Health check period
352 # Disabled (0) by default
353 health_check_timeout = 20
354 # Health check timeout
356 health_check_user = 'postgres'
358 health_check_password = ''
359 # This parameter is not yet implemented.
360 # Password for health check user
363 #------------------------------------------------------------------------------
364 # FAILOVER AND FAILBACK
365 #------------------------------------------------------------------------------
367 failover_command = '/usr/local/bin/failover.sh %d %H %P /tmp/trigger_file'
368 # Executes this command at failover
370 # %d = failed node id
371 # %h = failed host name
373 # %D = database cluster path
374 # %m = new master node id
375 # %H = hostname of the new master node
376 # %M = old master node id
377 # %P = old primary node id
379 failback_command = ''
380 # Executes this command at failback.
385 # %D = database cluster path
386 # %m = new master node id
387 # %H = hostname of the new master node
388 # %M = old master node id
389 # %P = old primary node id
392 fail_over_on_backend_error = on
393 # Initiates failover when writing to the
394 # backend communication socket fails
395 # This is the same behaviour of pgpool-II
396 # 2.2.x and previous releases
397 # If set to off, pgpool will report an
398 # error and disconnect the session.
401 #------------------------------------------------------------------------------
403 #------------------------------------------------------------------------------
405 recovery_user = 'postgres'
406 # Online recovery user
407 recovery_password = 'nopass'
408 # Online recovery password
409 #recovery_1st_stage_command = 'basebackup.sh'
410 # Executes a command in first stage
411 recovery_2nd_stage_command = ''
412 # Executes a command in second stage
413 recovery_timeout = 30
414 # Timeout in seconds to wait for the
415 # recovering node's postmaster to start up
417 client_idle_limit_in_recovery = 0
418 # Client is disconnected after being idle
419 # for that many seconds in the second stage
421 # 0 means no disconnection
422 # -1 means immediate disconnection
425 #------------------------------------------------------------------------------
427 #------------------------------------------------------------------------------
430 # Life time of relation cache in seconds.
431 # 0 means no cache expiration(the default).
432 # The relation cache is used for cache the
433 # query result against PostgreSQL system
434 # catalog to obtain various information
435 # including table structures or if it's a
436 # temporary table or not. The cache is
437 # maintained in a pgpool child local memory
438 # and being kept as long as it survives.
439 # If someone modify the table by using
440 # ALTER TABLE or some such, the relcache is
441 # not consistent anymore.
442 # For this purpose, cache_expiration
443 # controls the life time of the cache.