1 # ----------------------------
2 # pgPool-II configuration file a custom version
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)
34 # (change requires restart)
36 # Unix domain socket path
37 # The Debian package defaults to
39 # (change requires restart)
42 # - pgpool Communication Manager Connection Settings -
46 # (change requires restart)
47 pcp_socket_dir = '/tmp'
48 # Unix domain socket path for pcp
49 # The Debian package defaults to
51 # (change requires restart)
53 # - Backend Connection Settings -
55 backend_hostname0 = '{{.Values.container.name.primary}}'
58 backend_flag0= 'DISALLOW_TO_FAILOVER'
60 backend_hostname1 = '{{.Values.container.name.replica}}'
63 backend_flag1= 'DISALLOW_TO_FAILOVER'
65 #backend_hostname0 = 'master'
66 # Host name or IP address to connect to for backend 0
68 # Port number for backend 0
70 # Weight for backend 0 (only in load balancing mode)
71 #backend_data_directory0 = '/data'
72 # Data directory for backend 0
73 #backend_flag0 = 'ALLOW_TO_FAILOVER'
74 # Controls various backend behavior
75 # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
76 #backend_hostname1 = 'standby'
79 #backend_data_directory1 = '/data1'
80 #backend_flag1 = 'ALLOW_TO_FAILOVER'
85 # Use pool_hba.conf for client authentication
86 pool_passwd = 'pool_passwd'
87 # File name of pool_passwd for md5 authentication.
88 # "" disables pool_passwd.
89 # (change requires restart)
90 authentication_timeout = 60
91 # Delay in seconds to complete client authentication
98 # (change requires restart)
99 #ssl_key = './server.key'
100 # Path to the SSL private key file
101 # (change requires restart)
102 #ssl_cert = './server.cert'
103 # Path to the SSL public certificate file
104 # (change requires restart)
106 # Path to a single PEM format file
107 # containing CA root certificate(s)
108 # (change requires restart)
109 #ssl_ca_cert_dir = ''
110 # Directory containing CA root certificate(s)
111 # (change requires restart)
114 #------------------------------------------------------------------------------
116 #------------------------------------------------------------------------------
120 num_init_children = 5
122 # (change requires restart)
124 # Number of connections per pool
125 # (change requires restart)
129 child_life_time = 300
130 # Pool exits after being idle for this many seconds
131 child_max_connections = 0
132 # Pool exits after receiving that many connections
134 connection_life_time = 0
135 # Connection to backend closes after being idle for this many seconds
137 client_idle_limit = 0
138 # Client is disconnected after being idle for that many seconds
139 # (even inside an explicit transactions!)
140 # 0 means no disconnection
143 #------------------------------------------------------------------------------
145 #------------------------------------------------------------------------------
149 log_destination = 'stderr'
151 # Valid values are combinations of stderr,
152 # and syslog. Default to stderr.
157 # Print timestamp on each line
158 # (change requires restart)
163 # Hostname will be shown in ps status
164 # and in logs if connections are logged
167 log_per_node_statement = off
169 # with node and backend informations
170 log_standby_delay = 'if_over_threshold'
172 # Valid values are combinations of always,
173 # if_over_threshold, none
175 # - Syslog specific -
177 syslog_facility = 'LOCAL0'
178 # Syslog local facility. Default to LOCAL0
179 syslog_ident = 'pgpool'
180 # Syslog program identification string
181 # Default to 'pgpool'
186 # Debug message verbosity level
187 # 0 means no message, 1 or more mean verbose
190 #------------------------------------------------------------------------------
192 #------------------------------------------------------------------------------
194 pid_file_name = '/tmp/pgpool.pid'
196 # (change requires restart)
198 # Directory of pgPool status file
199 # (change requires restart)
202 #------------------------------------------------------------------------------
204 #------------------------------------------------------------------------------
206 connection_cache = off
207 # Activate connection pools
208 # (change requires restart)
210 # Semicolon separated list of queries
211 # to be issued at the end of a session
212 # The default is for 8.3 and later
213 reset_query_list = 'ABORT; DISCARD ALL'
214 # The following one is for 8.2 and before
215 #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
218 #------------------------------------------------------------------------------
220 #------------------------------------------------------------------------------
222 replication_mode = off
223 # Activate replication mode
224 # (change requires restart)
225 replicate_select = off
226 # Replicate SELECT statements
227 # when in replication or parallel mode
228 # replicate_select is higher priority than
232 # Automatically locks a dummy row or a table
233 # with INSERT statements to keep SERIAL data
235 # Without SERIAL, no lock will be issued
237 # When rewriting lo_creat command in
238 # replication mode, specify table name to
241 # - Degenerate handling -
243 replication_stop_on_mismatch = off
244 # On disagreement with the packet kind
245 # sent from backend, degenerate the node
246 # which is most likely "minority"
247 # If off, just force to exit this session
249 failover_if_affected_tuples_mismatch = off
250 # On disagreement with the number of affected
251 # tuples in UPDATE/DELETE queries, then
252 # degenerate the node which is most likely
254 # If off, just abort the transaction to
255 # keep the consistency
258 #------------------------------------------------------------------------------
259 # LOAD BALANCING MODE
260 #------------------------------------------------------------------------------
262 load_balance_mode = on
263 # Activate load balancing mode
264 # (change requires restart)
265 ignore_leading_white_space = on
266 # Ignore leading white spaces of each query
267 white_function_list = ''
268 # Comma separated list of function names
269 # that don't write to database
270 # Regexp are accepted
271 black_function_list = 'currval,lastval,nextval,setval'
272 # Comma separated list of function names
273 # that write to database
274 # Regexp are accepted
277 #------------------------------------------------------------------------------
279 #------------------------------------------------------------------------------
281 master_slave_mode = on
282 # Activate master/slave mode
283 # (change requires restart)
284 master_slave_sub_mode = 'stream'
285 # Master/slave sub mode
286 # Valid values are combinations slony or
287 # stream. Default is slony.
288 # (change requires restart)
293 # Streaming replication check period
294 # Disabled (0) by default
295 sr_check_user = '{{.Values.credentials.pgusername}}'
296 # Streaming replication check user
297 # This is neccessary even if you disable streaming
298 # replication delay check by sr_check_period = 0
299 sr_check_password = '{{.Values.credentials.pgpassword}}'
300 # Password for streaming replication check user
301 delay_threshold = 10000000
302 # Threshold before not dispatching query to standby node
304 # Disabled (0) by default
306 # - Special commands -
308 follow_master_command = ''
309 # Executes this command after master failover
314 # %D = database cluster path
315 # %m = new master node id
316 # %H = hostname of the new master node
317 # %M = old master node id
318 # %P = old primary node id
319 # %r = new master port number
320 # %R = new master database cluster path
324 #------------------------------------------------------------------------------
326 #------------------------------------------------------------------------------
329 # Activates parallel query mode
330 # (change requires restart)
331 pgpool2_hostname = ''
332 # Set pgpool2 hostname
333 # (change requires restart)
337 #system_db_hostname = 'localhost'
338 # (change requires restart)
339 #system_db_port = 5432
340 # (change requires restart)
341 #system_db_dbname = 'pgpool'
342 # (change requires restart)
343 #system_db_schema = 'pgpool_catalog'
344 # (change requires restart)
345 #system_db_user = 'pgpool'
346 # (change requires restart)
347 #system_db_password = ''
348 # (change requires restart)
351 #------------------------------------------------------------------------------
353 #------------------------------------------------------------------------------
355 health_check_period = 20
356 # Health check period
357 # Disabled (0) by default
358 health_check_timeout = 10
359 # Health check timeout
361 health_check_user = '{{.Values.credentials.pgusername}}'
363 health_check_password = '{{.Values.credentials.pgpassword}}'
364 # Password for health check user
365 health_check_max_retries = 3
366 connect_timeout = 10000 # Timeout value in milliseconds before giving up to connect to backend.
368 # Maximum number of times to retry a failed health check before giving up.
369 health_check_retry_delay = 1
370 # Amount of time to wait (in seconds) between retries.
373 #------------------------------------------------------------------------------
374 # FAILOVER AND FAILBACK
375 #------------------------------------------------------------------------------
377 failover_command = ''
378 # Executes this command at failover
383 # %D = database cluster path
384 # %m = new master node id
385 # %H = hostname of the new master node
386 # %M = old master node id
387 # %P = old primary node id
388 # %r = new master port number
389 # %R = new master database cluster path
391 failback_command = ''
392 # Executes this command at failback.
397 # %D = database cluster path
398 # %m = new master node id
399 # %H = hostname of the new master node
400 # %M = old master node id
401 # %P = old primary node id
402 # %r = new master port number
403 # %R = new master database cluster path
406 fail_over_on_backend_error = off
407 # Initiates failover when reading/writing to the
408 # backend communication socket fails
409 # If set to off, pgpool will report an
410 # error and disconnect the session.
412 search_primary_node_timeout = 10
413 # Timeout in seconds to search for the
414 # primary node when a failover occurs.
415 # 0 means no timeout, keep searching
416 # for a primary node forever.
418 #------------------------------------------------------------------------------
420 #------------------------------------------------------------------------------
422 recovery_user = '{{.Values.credentials.pgusername}}'
423 # Online recovery user
424 recovery_password = '{{.Values.credentials.pgpassword}}'
425 # Online recovery password
426 recovery_1st_stage_command = ''
427 # Executes a command in first stage
428 recovery_2nd_stage_command = ''
429 # Executes a command in second stage
430 recovery_timeout = 90
431 # Timeout in seconds to wait for the
432 # recovering node's postmaster to start up
434 client_idle_limit_in_recovery = 0
435 # Client is disconnected after being idle
436 # for that many seconds in the second stage
438 # 0 means no disconnection
439 # -1 means immediate disconnection
442 #------------------------------------------------------------------------------
444 #------------------------------------------------------------------------------
450 # (change requires restart)
452 # -Connection to up stream servers -
455 # trusted server list which are used
456 # to confirm network connection
457 # (hostA,hostB,hostC,...)
458 # (change requires restart)
461 # (change requires restart)
463 # - Watchdog communication Settings -
466 # Host name or IP address of this watchdog
467 # (change requires restart)
469 # port number for watchdog service
470 # (change requires restart)
472 # Authentication key for watchdog communication
473 # (change requires restart)
475 # - Virtual IP control Setting -
478 # delegate IP address
479 # If this is empty, virtual IP never bring up.
480 # (change requires restart)
481 ifconfig_path = '/sbin'
482 # ifconfig command path
483 # (change requires restart)
484 if_up_cmd = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0'
485 # startup delegate IP command
486 # (change requires restart)
487 if_down_cmd = 'ifconfig eth0:0 down'
488 # shutdown delegate IP command
489 # (change requires restart)
491 arping_path = '/usr/sbin' # arping command path
492 # (change requires restart)
494 arping_cmd = 'arping -U $_IP_$ -w 1'
496 # (change requires restart)
498 # - Behaivor on escalation Setting -
500 clear_memqcache_on_escalation = on
501 # Clear all the query cache on shared memory
502 # when standby pgpool escalate to active pgpool
503 # (= virtual IP holder).
504 # This should be off if client connects to pgpool
505 # not using virtual IP.
506 # (change requires restart)
507 wd_escalation_command = ''
508 # Executes this command at escalation on new active pgpool.
509 # (change requires restart)
511 # - Lifecheck Setting -
515 wd_lifecheck_method = 'heartbeat'
516 # Method of watchdog lifecheck ('heartbeat' or 'query')
517 # (change requires restart)
519 # lifecheck interval (sec) > 0
520 # (change requires restart)
522 # -- heartbeat mode --
524 wd_heartbeat_port = 9694
525 # Port number for receiving heartbeat signal
526 # (change requires restart)
527 wd_heartbeat_keepalive = 2
528 # Interval time of sending heartbeat signal (sec)
529 # (change requires restart)
530 wd_heartbeat_deadtime = 30
531 # Deadtime interval for heartbeat signal (sec)
532 # (change requires restart)
533 heartbeat_destination0 = 'host0_ip1'
534 # Host name or IP address of destination 0
535 # for sending heartbeat signal.
536 # (change requires restart)
537 heartbeat_destination_port0 = 9694
538 # Port number of destination 0 for sending
539 # heartbeat signal. Usually this is the
540 # same as wd_heartbeat_port.
541 # (change requires restart)
542 heartbeat_device0 = ''
543 # Name of NIC device (such like 'eth0')
544 # used for sending/receiving heartbeat
545 # signal to/from destination 0.
546 # This works only when this is not empty
547 # and pgpool has root privilege.
548 # (change requires restart)
550 #heartbeat_destination1 = 'host0_ip2'
551 #heartbeat_destination_port1 = 9694
552 #heartbeat_device1 = ''
557 # lifecheck retry times
558 # (change requires restart)
559 wd_lifecheck_query = 'SELECT 1'
560 # lifecheck query to pgpool from watchdog
561 # (change requires restart)
562 wd_lifecheck_dbname = 'template1'
563 # Database name connected for lifecheck
564 # (change requires restart)
565 wd_lifecheck_user = 'nobody'
566 # watchdog user monitoring pgpools in lifecheck
567 # (change requires restart)
568 wd_lifecheck_password = ''
569 # Password for watchdog user in lifecheck
570 # (change requires restart)
572 # - Other pgpool Connection Settings -
574 #other_pgpool_hostname0 = 'host0'
575 # Host name or IP address to connect to for other pgpool 0
576 # (change requires restart)
577 #other_pgpool_port0 = 5432
578 # Port number for othet pgpool 0
579 # (change requires restart)
580 #other_wd_port0 = 9000
581 # Port number for othet watchdog 0
582 # (change requires restart)
583 #other_pgpool_hostname1 = 'host1'
584 #other_pgpool_port1 = 5432
585 #other_wd_port1 = 9000
588 #------------------------------------------------------------------------------
590 #------------------------------------------------------------------------------
592 # Life time of relation cache in seconds.
593 # 0 means no cache expiration(the default).
594 # The relation cache is used for cache the
595 # query result against PostgreSQL system
596 # catalog to obtain various information
597 # including table structures or if it's a
598 # temporary table or not. The cache is
599 # maintained in a pgpool child local memory
600 # and being kept as long as it survives.
601 # If someone modify the table by using
602 # ALTER TABLE or some such, the relcache is
603 # not consistent anymore.
604 # For this purpose, cache_expiration
605 # controls the life time of the cache.
607 # Number of relation cache
608 # entry. If you see frequently:
609 # "pool_search_relcache: cache replacement happend"
610 # in the pgpool log, you might want to increate this number.
612 check_temp_table = on
613 # If on, enable temporary table check in SELECT statements.
614 # This initiates queries against system catalog of primary/master
615 # thus increases load of master.
616 # If you are absolutely sure that your system never uses temporary tables
617 # and you want to save access to primary/master, you could turn this off.
621 #------------------------------------------------------------------------------
622 # ON MEMORY QUERY MEMORY CACHE
623 #------------------------------------------------------------------------------
624 memory_cache_enabled = off
625 # If on, use the memory cache functionality, off by default
626 memqcache_method = 'shmem'
627 # Cache storage method. either 'shmem'(shared memory) or
628 # 'memcached'. 'shmem' by default
629 # (change requires restart)
630 memqcache_memcached_host = 'localhost'
631 # Memcached host name or IP address. Mandatory if
632 # memqcache_method = 'memcached'.
633 # Defaults to localhost.
634 # (change requires restart)
635 memqcache_memcached_port = 11211
636 # Memcached port number. Mondatory if memqcache_method = 'memcached'.
638 # (change requires restart)
639 memqcache_total_size = 67108864
640 # Total memory size in bytes for storing memory cache.
641 # Mandatory if memqcache_method = 'shmem'.
643 # (change requires restart)
644 memqcache_max_num_cache = 1000000
645 # Total number of cache entries. Mandatory
646 # if memqcache_method = 'shmem'.
647 # Each cache entry consumes 48 bytes on shared memory.
648 # Defaults to 1,000,000(45.8MB).
649 # (change requires restart)
651 # Memory cache entry life time specified in seconds.
652 # 0 means infinite life time. 0 by default.
653 # (change requires restart)
654 memqcache_auto_cache_invalidation = on
655 # If on, invalidation of query cache is triggered by corresponding
656 # DDL/DML/DCL(and memqcache_expire). If off, it is only triggered
657 # by memqcache_expire. on by default.
658 # (change requires restart)
659 memqcache_maxcache = 409600
660 # Maximum SELECT result size in bytes.
661 # Must be smaller than memqcache_cache_block_size. Defaults to 400KB.
662 # (change requires restart)
663 memqcache_cache_block_size = 1048576
664 # Cache block size in bytes. Mandatory if memqcache_method = 'shmem'.
666 # (change requires restart)
667 memqcache_oiddir = '/var/log/pgpool/oiddir'
668 # Temporary work directory to record table oids
669 # (change requires restart)
670 white_memqcache_table_list = ''
671 # Comma separated list of table names to memcache
672 # that don't write to database
673 # Regexp are accepted
674 black_memqcache_table_list = ''
675 # Comma separated list of table names not to memcache
676 # that don't write to database
677 # Regexp are accepted