|
listen_addresses = '*' #所有地址都可以访问
port = 9999 #端口自定义
socket_dir = '/var/run/postgresql' #pg建议放在/var/run/postgresql
listen_backlog_multiplier = 2
serialize_accept = off
pcp_listen_addresses = '*'
pcp_port = 9898
pcp_socket_dir = '/var/run/postgresql' #pg建议放在/var/run/postgresql
backend_hostname0 = '192.168.180.222' #配置数据节点
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/postgresql/9.5/main'
backend_flag0 = 'ALLOW_TO_FAILOVER'
backend_hostname1 = '192.168.180.223' #配置数据节点
backend_port1 = 5432
backend_weight1 = 1
backend_data_directory1 = '/var/lib/postgresql/9.5/main'
backend_flag1 = 'ALLOW_TO_FAILOVER'
enable_pool_hba = on
pool_passwd = 'pool_passwd'
authentication_timeout = 60
ssl = off
num_init_children = 32
max_pool = 4
child_life_time = 300
child_max_connections = 0
connection_life_time = 450
client_idle_limit = 300
log_destination = 'syslog'
log_line_prefix = '%t: pid %p: '
log_connections = off
log_hostname = off
log_statement = off
log_per_node_statement = off
log_standby_delay = 'none'
syslog_facility = 'LOCAL0'
syslog_ident = 'pgpool'
debug_level = 0
pid_file_name = '/var/run/pgpool/pgpool.pid'
logdir = '/tmp'
connection_cache = on
reset_query_list = 'ABORT; DISCARD ALL'
replication_mode = off
replicate_select = off
insert_lock = off
lobj_lock_table = ''
replication_stop_on_mismatch = off
failover_if_affected_tuples_mismatch = off
load_balance_mode = on
ignore_leading_white_space = on
white_function_list = ''
black_function_list = 'currval,lastval,nextval,setval'
database_redirect_preference_list = ''
app_name_redirect_preference_list = ''
allow_sql_comments = off
master_slave_mode = on # 设置流复制模式
master_slave_sub_mode = 'stream' # 设置流复制模式,采用postgresql自身的流复制
sr_check_period = 5
sr_check_user = 'postgres'
sr_check_password = 'postgres'
sr_check_database = 'postgres'
delay_threshold = 0
follow_master_command = ''
health_check_period = 1 #健康检查开启
health_check_timeout = 10 #10秒超时就算挂了
health_check_user = 'postgres' #检查的用户
health_check_password = 'postgres' #检查的密码
health_check_database = 'postgres' #检查的数据库
health_check_max_retries = 1 #最大重试次数
health_check_retry_delay = 2 #每次重试延迟
connect_timeout = 10000
failover_command = '/usr/lib/postgresql/9.5/bin/failover_stream.sh %d %H /tmp/trigger_file0' #配置 failover 脚本,脚本内容下面会贴出。
failback_command = ''
fail_over_on_backend_error = on
search_primary_node_timeout = 10
recovery_user = 'postgres'
recovery_password = 'postgres'
recovery_1st_stage_command = ''
recovery_2nd_stage_command = ''
recovery_timeout = 90
client_idle_limit_in_recovery = 0
use_watchdog = on #使用watch dog
trusted_servers = ''
ping_path = '/bin'
wd_hostname = '192.168.180.222' #配置watch dog绑定的IP
wd_port = 9000 #配置watch dog端口
wd_priority = 1
wd_authkey = ''
wd_ipc_socket_dir = '/tmp'
delegate_IP = '192.168.180.221' #配置 pgpool 的 VIP,避免 pgpool 的单点故障
if_cmd_path = '/sbin' #以下几个网卡命令不需要修改
if_up_cmd = 'ip addr add $_IP_$/24 dev eth0 label eth0:0'
if_down_cmd = 'ip addr del $_IP_$/24 dev eth0'
arping_path = '/usr/sbin'
arping_cmd = 'arping -U $_IP_$ -w 1'
clear_memqcache_on_escalation = on
wd_escalation_command = ''
wd_de_escalation_command = ''
wd_monitoring_interfaces_list = ''
wd_lifecheck_method = 'heartbeat'
wd_interval = 10
wd_heartbeat_port = 9694
wd_heartbeat_keepalive = 2
wd_heartbeat_deadtime = 30
heartbeat_destination0 = '192.168.180.223' #配置对端的 hostname
heartbeat_destination_port0 = 9694 #配置对端的 hostname
heartbeat_device0 = 'eth0' #配置对端的 hostname
wd_life_point = 3
wd_lifecheck_query = 'SELECT 1'
wd_lifecheck_dbname = 'postgres'
wd_lifecheck_user = 'postgres'
wd_lifecheck_password = 'postgres'
other_pgpool_hostname0 = '192.168.180.223' #配置对端的 pgpool
other_pgpool_port0 = 9999 #配置对端的 pgpool
other_wd_port0 = 9000 #配置对端的 pgpool-wacthdog
relcache_expire = 0
relcache_size = 256
check_temp_table = on
check_unlogged_table = on
memory_cache_enabled = off
memqcache_method = 'shmem'
memqcache_memcached_host = 'localhost'
memqcache_memcached_port = 11211
memqcache_total_size = 67108864
memqcache_max_num_cache = 1000000
memqcache_expire = 0
memqcache_auto_cache_invalidation = on
memqcache_maxcache = 409600
memqcache_cache_block_size = 1048576
memqcache_oiddir = '/var/log/pgpool/oiddir'
white_memqcache_table_list = ''
black_memqcache_table_list = '' |
|
|
|
|
|
|