-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpgbalancer_pgraft.conf
More file actions
97 lines (81 loc) 路 2.44 KB
/
Copy pathpgbalancer_pgraft.conf
File metadata and controls
97 lines (81 loc) 路 2.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#-------------------------------------------------------------------
# pgbalancer with pgraft Consensus Integration - Test Configuration
#-------------------------------------------------------------------
# Connection Pooling
listen_addresses = '*'
port = 9999
socket_dir = '/tmp'
pcp_listen_addresses = '*'
pcp_port = 9898
pid_file_name = '/tmp/pgbalancer_pgraft.pid'
logdir = '/tmp/pgbalancer_pgraft_logs'
# PostgreSQL Backend Nodes (3-node pgraft cluster)
backend_hostname0 = '127.0.0.1'
backend_port0 = 5440
backend_weight0 = 1
backend_flag0 = 'ALWAYS_PRIMARY'
backend_hostname1 = '127.0.0.1'
backend_port1 = 5441
backend_weight1 = 1
backend_flag1 = 'ALLOW_TO_FAILOVER'
backend_hostname2 = '127.0.0.1'
backend_port2 = 5442
backend_weight2 = 1
backend_flag2 = 'ALLOW_TO_FAILOVER'
# Authentication
enable_pool_hba = off
allow_clear_text_frontend_auth = on
# Watchdog and Consensus Configuration
use_watchdog = on
consensus_mode = on # off = heuristic (default), on = pgraft (Raft consensus)
# Watchdog Basic Settings
wd_hostname0 = '127.0.0.1'
wd_port0 = 9000
pgbalancer_hostname0 = '127.0.0.1'
pgbalancer_port0 = 9999
pgbalancer_node_id = 0
wd_authkey = ''
# Failover Configuration
failover_when_quorum_exists = on
failover_require_consensus = on
failover_command = ''
follow_primary_command = ''
failback_command = ''
# Health Check
health_check_period = 10
health_check_timeout = 5
health_check_user = 'postgres'
health_check_password = ''
health_check_database = 'postgres'
health_check_max_retries = 3
health_check_retry_delay = 1
# Load Balancing
load_balance_mode = on
black_function_list = 'currval,lastval,nextval,setval'
white_function_list = ''
# Streaming Replication Check
sr_check_period = 10
sr_check_user = 'postgres'
sr_check_password = ''
sr_check_database = 'postgres'
# Connection Pool
num_init_children = 32
max_pool = 4
child_life_time = 300
child_max_connections = 0
connection_life_time = 0
client_idle_limit = 0
# Logging
log_destination = 'stderr'
logging_collector = on
log_directory = '/tmp/pgbalancer_pgraft_logs'
log_filename = 'pgbalancer-%Y-%m-%d_%H%M%S.log'
log_truncate_on_rotation = on
log_rotation_age = 1d
log_rotation_size = 10MB
log_min_messages = debug1
# pgraft-specific: PostgreSQL connection for consensus
# pgraft will connect to the backend nodes directly
# Backend nodes should have pgraft extension installed
# Cluster members (optional - for documentation)
# This pgbalancer node will use pgraft on backend nodes for leader election