Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add pgpool.conf sample for replication mode and master/slave mode

  • Loading branch information...
commit 276d653f2647b85c25ca3e72f54cbff715a8585d 1 parent 037662e
t-ishii authored
216 pgpool.conf.sample-master-slave
... ... @@ -0,0 +1,216 @@
  1 +#
  2 +# pgpool-II configuration file sample for master/slave mode
  3 +# $Header: /cvsroot/pgpool/pgpool-II/pgpool.conf.sample-master-slave,v 1.1 2009/12/06 09:57:32 t-ishii Exp $
  4 +
  5 +# Host name or IP address to listen on: '*' for all, '' for no TCP/IP
  6 +# connections
  7 +listen_addresses = 'localhost'
  8 +
  9 +# Port number for pgpool
  10 +port = 9999
  11 +
  12 +# Port number for pgpool communication manager
  13 +pcp_port = 9898
  14 +
  15 +# Unix domain socket path. (The Debian package defaults to
  16 +# /var/run/postgresql.)
  17 +socket_dir = '/tmp'
  18 +
  19 +# Unix domain socket path for pgpool communication manager.
  20 +# (Debian package defaults to /var/run/postgresql)
  21 +pcp_socket_dir = '/tmp'
  22 +
  23 +# Unix domain socket path for the backend. Debian package defaults to /var/run/postgresql!
  24 +backend_socket_dir = '/tmp'
  25 +
  26 +# pgpool communication manager timeout. 0 means no timeout, but strongly not recommended!
  27 +pcp_timeout = 10
  28 +
  29 +# number of pre-forked child process
  30 +num_init_children = 32
  31 +
  32 +# Number of connection pools allowed for a child process
  33 +max_pool = 4
  34 +
  35 +# If idle for this many seconds, child exits. 0 means no timeout.
  36 +child_life_time = 300
  37 +
  38 +# If idle for this many seconds, connection to PostgreSQL closes.
  39 +# 0 means no timeout.
  40 +connection_life_time = 0
  41 +
  42 +# If child_max_connections connections were received, child exits.
  43 +# 0 means no exit.
  44 +child_max_connections = 0
  45 +
  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
  48 +# transactions!)
  49 +# 0 means no disconnect.
  50 +client_idle_limit = 0
  51 +
  52 +# Maximum time in seconds to complete client authentication.
  53 +# 0 means no timeout.
  54 +authentication_timeout = 60
  55 +
  56 +# Logging directory
  57 +logdir = '/tmp'
  58 +
  59 +# pid file name
  60 +pid_file_name = '/var/run/pgpool/pgpool.pid'
  61 +
  62 +# Replication mode
  63 +replication_mode = false
  64 +
  65 +# Load balancing mode, i.e., all SELECTs are load balanced.
  66 +# This is ignored if replication_mode is false.
  67 +load_balance_mode = true
  68 +
  69 +# if there's a data mismatch between master and secondary
  70 +# start degeneration to stop replication mode
  71 +replication_stop_on_mismatch = false
  72 +
  73 +# If true, replicate SELECT statement when load balancing is disabled.
  74 +# If false, it is only sent to the master node.
  75 +replicate_select = false
  76 +
  77 +# Semicolon separated list of queries to be issued at the end of a
  78 +# session
  79 +reset_query_list = 'ABORT; DISCARD ALL'
  80 +# for 8.2 or older this should be as follows.
  81 +#reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
  82 +
  83 +# If true print timestamp on each log line.
  84 +print_timestamp = true
  85 +
  86 +# If true, operate in master/slave mode.
  87 +master_slave_mode = true
  88 +
  89 +# If true, cache connection pool.
  90 +connection_cache = true
  91 +
  92 +# Health check timeout. 0 means no timeout.
  93 +health_check_timeout = 20
  94 +
  95 +# Health check period. 0 means no health check.
  96 +health_check_period = 0
  97 +
  98 +# Health check user
  99 +health_check_user = 'nobody'
  100 +
  101 +# Execute command by failover.
  102 +# special values: %d = node id
  103 +# %h = host name
  104 +# %p = port number
  105 +# %D = database cluster path
  106 +# %m = new master node id
  107 +# %M = old master node id
  108 +# %% = '%' character
  109 +#
  110 +failover_command = ''
  111 +
  112 +# Execute command by failback.
  113 +# special values: %d = node id
  114 +# %h = host name
  115 +# %p = port number
  116 +# %D = database cluster path
  117 +# %m = new master node id
  118 +# %M = old master node id
  119 +# %% = '%' character
  120 +#
  121 +failback_command = ''
  122 +
  123 +# If true, trigger fail over when writing to the backend communication
  124 +# socket fails. This is the same behavior of pgpool-II 2.2.x or
  125 +# earlier. If set to false, pgpool will report an error and disconnect
  126 +# the session.
  127 +fail_over_on_backend_error = true
  128 +
  129 +# If true, automatically locks a table with INSERT statements to keep
  130 +# SERIAL data consistency. If the data does not have SERIAL data
  131 +# type, no lock will be issued. An /*INSERT LOCK*/ comment has the
  132 +# same effect. A /NO INSERT LOCK*/ comment disables the effect.
  133 +insert_lock = true
  134 +
  135 +# If true, ignore leading white spaces of each query while pgpool judges
  136 +# whether the query is a SELECT so that it can be load balanced. This
  137 +# is useful for certain APIs such as DBI/DBD which is known to adding an
  138 +# extra leading white space.
  139 +ignore_leading_white_space = true
  140 +
  141 +# If true, print all statements to the log. Like the log_statement option
  142 +# to PostgreSQL, this allows for observing queries without engaging in full
  143 +# debugging.
  144 +log_statement = false
  145 +
  146 +# If true, print all statements to the log. Similar to log_statement except
  147 +# that prints DB node id and backend process id info.
  148 +log_per_node_statement = false
  149 +
  150 +# If true, incoming connections will be printed to the log.
  151 +log_connections = false
  152 +
  153 +# If true, hostname will be shown in ps status. Also shown in
  154 +# connection log if log_connections = true.
  155 +# Be warned that this feature will add overhead to look up hostname.
  156 +log_hostname = false
  157 +
  158 +# if non 0, run in parallel query mode
  159 +parallel_mode = false
  160 +
  161 +# if non 0, use query cache
  162 +enable_query_cache = false
  163 +
  164 +#set pgpool2 hostname
  165 +pgpool2_hostname = ''
  166 +
  167 +# system DB info
  168 +system_db_hostname = 'localhost'
  169 +system_db_port = 5432
  170 +system_db_dbname = 'pgpool'
  171 +system_db_schema = 'pgpool_catalog'
  172 +system_db_user = 'pgpool'
  173 +system_db_password = ''
  174 +
  175 +# backend_hostname, backend_port, backend_weight
  176 +# here are examples
  177 +backend_hostname0 = 'host1'
  178 +backend_port0 = 5432
  179 +backend_weight0 = 1
  180 +backend_data_directory0 = '/data'
  181 +backend_hostname1 = 'host2'
  182 +backend_port1 = 5432
  183 +backend_weight1 = 1
  184 +backend_data_directory1 = '/data1'
  185 +
  186 +# - HBA -
  187 +
  188 +# If true, use pool_hba.conf for client authentication. In pgpool-II
  189 +# 1.1, the default value is false. The default value will be true in
  190 +# 1.2.
  191 +enable_pool_hba = false
  192 +
  193 +# - online recovery -
  194 +# online recovery user
  195 +recovery_user = 'nobody'
  196 +
  197 +# online recovery password
  198 +recovery_password = ''
  199 +
  200 +# execute a command in first stage.
  201 +recovery_1st_stage_command = ''
  202 +
  203 +# execute a command in second stage.
  204 +recovery_2nd_stage_command = ''
  205 +
  206 +# maximum time in seconds to wait for the recovering node's postmaster
  207 +# start-up. 0 means no wait.
  208 +# this is also used as a timer waiting for clients disconnected before
  209 +# starting 2nd stage
  210 +recovery_timeout = 90
  211 +
  212 +# If client_idle_limit_in_recovery is n (n > 0), the client is forced
  213 +# to be disconnected whenever after n seconds idle (even inside an
  214 +# explicit transactions!) 0 means no disconnect. This parameter only
  215 +# takes effect in recovery 2nd stage.
  216 +client_idle_limit_in_recovery = 0
216 pgpool.conf.sample-replication
... ... @@ -0,0 +1,216 @@
  1 +#
  2 +# pgpool-II configuration file sample for replication mode
  3 +# $Header: /cvsroot/pgpool/pgpool-II/pgpool.conf.sample-replication,v 1.1 2009/12/06 09:57:32 t-ishii Exp $
  4 +
  5 +# Host name or IP address to listen on: '*' for all, '' for no TCP/IP
  6 +# connections
  7 +listen_addresses = 'localhost'
  8 +
  9 +# Port number for pgpool
  10 +port = 9999
  11 +
  12 +# Port number for pgpool communication manager
  13 +pcp_port = 9898
  14 +
  15 +# Unix domain socket path. (The Debian package defaults to
  16 +# /var/run/postgresql.)
  17 +socket_dir = '/tmp'
  18 +
  19 +# Unix domain socket path for pgpool communication manager.
  20 +# (Debian package defaults to /var/run/postgresql)
  21 +pcp_socket_dir = '/tmp'
  22 +
  23 +# Unix domain socket path for the backend. Debian package defaults to /var/run/postgresql!
  24 +backend_socket_dir = '/tmp'
  25 +
  26 +# pgpool communication manager timeout. 0 means no timeout, but strongly not recommended!
  27 +pcp_timeout = 10
  28 +
  29 +# number of pre-forked child process
  30 +num_init_children = 32
  31 +
  32 +# Number of connection pools allowed for a child process
  33 +max_pool = 4
  34 +
  35 +# If idle for this many seconds, child exits. 0 means no timeout.
  36 +child_life_time = 300
  37 +
  38 +# If idle for this many seconds, connection to PostgreSQL closes.
  39 +# 0 means no timeout.
  40 +connection_life_time = 0
  41 +
  42 +# If child_max_connections connections were received, child exits.
  43 +# 0 means no exit.
  44 +child_max_connections = 0
  45 +
  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
  48 +# transactions!)
  49 +# 0 means no disconnect.
  50 +client_idle_limit = 0
  51 +
  52 +# Maximum time in seconds to complete client authentication.
  53 +# 0 means no timeout.
  54 +authentication_timeout = 60
  55 +
  56 +# Logging directory
  57 +logdir = '/tmp'
  58 +
  59 +# pid file name
  60 +pid_file_name = '/var/run/pgpool/pgpool.pid'
  61 +
  62 +# Replication mode
  63 +replication_mode = true
  64 +
  65 +# Load balancing mode, i.e., all SELECTs are load balanced.
  66 +# This is ignored if replication_mode is false.
  67 +load_balance_mode = true
  68 +
  69 +# if there's a data mismatch between master and secondary
  70 +# start degeneration to stop replication mode
  71 +replication_stop_on_mismatch = false
  72 +
  73 +# If true, replicate SELECT statement when load balancing is disabled.
  74 +# If false, it is only sent to the master node.
  75 +replicate_select = false
  76 +
  77 +# Semicolon separated list of queries to be issued at the end of a
  78 +# session
  79 +reset_query_list = 'ABORT; DISCARD ALL'
  80 +# for 8.2 or older this should be as follows.
  81 +#reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'
  82 +
  83 +# If true print timestamp on each log line.
  84 +print_timestamp = true
  85 +
  86 +# If true, operate in master/slave mode.
  87 +master_slave_mode = false
  88 +
  89 +# If true, cache connection pool.
  90 +connection_cache = true
  91 +
  92 +# Health check timeout. 0 means no timeout.
  93 +health_check_timeout = 20
  94 +
  95 +# Health check period. 0 means no health check.
  96 +health_check_period = 0
  97 +
  98 +# Health check user
  99 +health_check_user = 'nobody'
  100 +
  101 +# Execute command by failover.
  102 +# special values: %d = node id
  103 +# %h = host name
  104 +# %p = port number
  105 +# %D = database cluster path
  106 +# %m = new master node id
  107 +# %M = old master node id
  108 +# %% = '%' character
  109 +#
  110 +failover_command = ''
  111 +
  112 +# Execute command by failback.
  113 +# special values: %d = node id
  114 +# %h = host name
  115 +# %p = port number
  116 +# %D = database cluster path
  117 +# %m = new master node id
  118 +# %M = old master node id
  119 +# %% = '%' character
  120 +#
  121 +failback_command = ''
  122 +
  123 +# If true, trigger fail over when writing to the backend communication
  124 +# socket fails. This is the same behavior of pgpool-II 2.2.x or
  125 +# earlier. If set to false, pgpool will report an error and disconnect
  126 +# the session.
  127 +fail_over_on_backend_error = true
  128 +
  129 +# If true, automatically locks a table with INSERT statements to keep
  130 +# SERIAL data consistency. If the data does not have SERIAL data
  131 +# type, no lock will be issued. An /*INSERT LOCK*/ comment has the
  132 +# same effect. A /NO INSERT LOCK*/ comment disables the effect.
  133 +insert_lock = true
  134 +
  135 +# If true, ignore leading white spaces of each query while pgpool judges
  136 +# whether the query is a SELECT so that it can be load balanced. This
  137 +# is useful for certain APIs such as DBI/DBD which is known to adding an
  138 +# extra leading white space.
  139 +ignore_leading_white_space = true
  140 +
  141 +# If true, print all statements to the log. Like the log_statement option
  142 +# to PostgreSQL, this allows for observing queries without engaging in full
  143 +# debugging.
  144 +log_statement = false
  145 +
  146 +# If true, print all statements to the log. Similar to log_statement except
  147 +# that prints DB node id and backend process id info.
  148 +log_per_node_statement = false
  149 +
  150 +# If true, incoming connections will be printed to the log.
  151 +log_connections = false
  152 +
  153 +# If true, hostname will be shown in ps status. Also shown in
  154 +# connection log if log_connections = true.
  155 +# Be warned that this feature will add overhead to look up hostname.
  156 +log_hostname = false
  157 +
  158 +# if non 0, run in parallel query mode
  159 +parallel_mode = false
  160 +
  161 +# if non 0, use query cache
  162 +enable_query_cache = false
  163 +
  164 +#set pgpool2 hostname
  165 +pgpool2_hostname = ''
  166 +
  167 +# system DB info
  168 +system_db_hostname = 'localhost'
  169 +system_db_port = 5432
  170 +system_db_dbname = 'pgpool'
  171 +system_db_schema = 'pgpool_catalog'
  172 +system_db_user = 'pgpool'
  173 +system_db_password = ''
  174 +
  175 +# backend_hostname, backend_port, backend_weight
  176 +# here are examples
  177 +backend_hostname0 = 'host1'
  178 +backend_port0 = 5432
  179 +backend_weight0 = 1
  180 +backend_data_directory0 = '/data'
  181 +backend_hostname1 = 'host2'
  182 +backend_port1 = 5432
  183 +backend_weight1 = 1
  184 +backend_data_directory1 = '/data1'
  185 +
  186 +# - HBA -
  187 +
  188 +# If true, use pool_hba.conf for client authentication. In pgpool-II
  189 +# 1.1, the default value is false. The default value will be true in
  190 +# 1.2.
  191 +enable_pool_hba = false
  192 +
  193 +# - online recovery -
  194 +# online recovery user
  195 +recovery_user = 'nobody'
  196 +
  197 +# online recovery password
  198 +recovery_password = ''
  199 +
  200 +# execute a command in first stage.
  201 +recovery_1st_stage_command = ''
  202 +
  203 +# execute a command in second stage.
  204 +recovery_2nd_stage_command = ''
  205 +
  206 +# maximum time in seconds to wait for the recovering node's postmaster
  207 +# start-up. 0 means no wait.
  208 +# this is also used as a timer waiting for clients disconnected before
  209 +# starting 2nd stage
  210 +recovery_timeout = 90
  211 +
  212 +# If client_idle_limit_in_recovery is n (n > 0), the client is forced
  213 +# to be disconnected whenever after n seconds idle (even inside an
  214 +# explicit transactions!) 0 means no disconnect. This parameter only
  215 +# takes effect in recovery 2nd stage.
  216 +client_idle_limit_in_recovery = 0

0 comments on commit 276d653

Please sign in to comment.
Something went wrong with that request. Please try again.