pgpool+postgresql异步流复制+数据库集群及负载的配置方法

# - Pool size -

num_init_children = 32

# Number of pools # (change requires restart) max_pool = 4

# Number of connections per pool # (change requires restart)

# - Life time -

child_life_time = 300

# Pool exits after being idle for this many seconds child_max_connections = 0

# Pool exits after receiving that many connections # 0 means no exit connection_life_time = 0

# Connection to backend closes after being idle for this many seconds # 0 means no close client_idle_limit = 0

# Client is disconnected after being idle for that many seconds # (even inside an explicit transactions!) # 0 means no disconnection

#------------------------------------------------------------------------------ # LOGS

#------------------------------------------------------------------------------

# - Where to log -

log_destination = 'stderr'

# Where to log

# Valid values are combinations of stderr, # and syslog. Default to stderr.

# - What to log -

log_line_prefix = '%t: pid %p: ' # printf-style string to output at beginning of each log line.

log_connections = off

# Log connections log_hostname = off

# Hostname will be shown in ps status # and in logs if connections are logged log_statement = off

# Log all statements log_per_node_statement = off

# Log all statements

# with node and backend informations

log_standby_delay = 'if_over_threshold'

# Log standby delay

# Valid values are combinations of always, # if_over_threshold, none

# - Syslog specific -

syslog_facility = 'LOCAL0'

# Syslog local facility. Default to LOCAL0 syslog_ident = 'pgpool'

# Syslog program identification string # Default to 'pgpool'

# - Debug -

debug_level = 0

# Debug message verbosity level

# 0 means no message, 1 or more mean verbose

#log_error_verbosity = default # terse, default, or verbose messages

#client_min_messages = notice # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # log # notice # warning # error

#log_min_messages = warning # values in order of decreasing detail: # debug5 # debug4 # debug3 # debug2 # debug1 # info # notice # warning # error # log # fatal # panic

#------------------------------------------------------------------------------ # FILE LOCATIONS

#------------------------------------------------------------------------------

pid_file_name = '/usr/local/pgpool/pgpool.pid'

# PID file name

# (change requires restart) logdir = '/tmp'

# Directory of pgPool status file # (change requires restart)

#------------------------------------------------------------------------------ # CONNECTION POOLING

#------------------------------------------------------------------------------

connection_cache = on

# Activate connection pools # (change requires restart)

# Semicolon separated list of queries # to be issued at the end of a session # The default is for 8.3 and later reset_query_list = 'ABORT; DISCARD ALL'

# The following one is for 8.2 and before #reset_query_list = 'ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT'

#------------------------------------------------------------------------------ # REPLICATION MODE

#------------------------------------------------------------------------------

replication_mode = off

# Activate replication mode # (change requires restart) replicate_select = off

# Replicate SELECT statements # when in replication mode

# replicate_select is higher priority than # load_balance_mode.

insert_lock = off

# Automatically locks a dummy row or a table # with INSERT statements to keep SERIAL data # consistency

# Without SERIAL, no lock will be issued lobj_lock_table = ''

# When rewriting lo_creat command in # replication mode, specify table name to # lock

# - Degenerate handling -

replication_stop_on_mismatch = off

# On disagreement with the packet kind # sent from backend, degenerate the node # which is most likely \ # If off, just force to exit this session

failover_if_affected_tuples_mismatch = off

# On disagreement with the number of affected # tuples in UPDATE/DELETE queries, then # degenerate the node which is most likely # \

# If off, just abort the transaction to # keep the consistency

#------------------------------------------------------------------------------ # LOAD BALANCING MODE

#------------------------------------------------------------------------------

load_balance_mode = on

# Activate load balancing mode # (change requires restart) ignore_leading_white_space = on

# Ignore leading white spaces of each query white_function_list = ''

# Comma separated list of function names # that don't write to database # Regexp are accepted black_function_list = 'currval,lastval,nextval,setval'

# Comma separated list of function names # that write to database # Regexp are accepted

database_redirect_preference_list = ''

app_name_redirect_preference_list = ''

# comma separated list of pairs of app name and node id. # example: 'psql:primary,myapp[0-4]:1,myapp[5-9]:standby' # valid for streaming replicaton mode only.

# comma separated list of pairs of database and node id. # example: postgres:primary,mydb[0-4]:1,mydb[5-9]:2' # valid for streaming replicaton mode only.

allow_sql_comments = off

#------------------------------------------------------------------------------ # MASTER/SLAVE MODE

#------------------------------------------------------------------------------

# if on, ignore SQL comments when judging if load balance or # query cache is possible.

# If off, SQL comments effectively prevent the judgment # (pre 3.4 behavior).

联系客服:779662525#qq.com(#替换为@)