-
Notifications
You must be signed in to change notification settings - Fork 13
/
inventory.yml
141 lines (141 loc) · 4.43 KB
/
inventory.yml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
---
pgpool:
hosts:
pgpool01:
ansible_host: 192.168.56.10
pgpool_wd_hostname: pgsql01
pgpool_wd_priority: 1
# watchdog
pgpool_heartbeat_destination:
- hostname: pgsql02
- hostname: pgsql03
pgpool_other_settings:
- hostname: pgsql02
- hostname: pgsql03
pgpool02:
ansible_host: 192.168.56.11
pgpool_wd_hostname: pgsql02
pgpool_wd_priority: 2
# watchdog
pgpool_heartbeat_destination:
- hostname: pgsql01
- hostname: pgsql03
pgpool_other_settings:
- hostname: pgsql01
- hostname: pgsql03
pgpool03:
ansible_host: 192.168.56.12
pgpool_wd_hostname: pgsql03
pgpool_wd_priority: 3
# watchdog
pgpool_heartbeat_destination:
- hostname: pgsql01
- hostname: pgsql02
pgpool_other_settings:
- hostname: pgsql01
- hostname: pgsql02
vars:
pgpool_postgresql_version: 12
# .pcpass file
pgpool_pcppass_entries:
- hostname: pgsql01
port: 9898
user: pgpool
password: pgpool
- hostname: pgsql02
port: 9898
user: pgpool
password: pgpool
- hostname: pgsql03
port: 9898
user: pgpool
password: pgpool
- hostname: "{{ pgpool_pcp_socket_dir }}" # allows using -h /var/run/pcp instead of 'localhost'
port: 9898
user: pgpool
password: pgpool
- hostname: 127.0.0.1
port: 9898
user: pgpool
password: pgpool
# pool_passwd
pgpool_passwd_users_md5:
- username: admin
password: secret
# backend settings
pgpool_backend_servers:
- hostname: pgsql01
port: 5432
weight: 1
data_directory: "{{ pgpool_postgresql_data_directory }}"
flag: ALLOW_TO_FAILOVER
application_name: pgsql01
- hostname: pgsql02
port: 5432
weight: 1
data_directory: "{{ pgpool_postgresql_data_directory }}"
flag: ALLOW_TO_FAILOVER
application_name: pgsql02
- hostname: pgsql03
port: 5432
weight: 1
data_directory: "{{ pgpool_postgresql_data_directory }}"
flag: ALLOW_TO_FAILOVER
application_name: pgsql03
# authentication
pgpool_enable_pool_hba: on
pgpool_pool_hba_entries:
- type: host
database: all
user: admin
address: 192.168.56.0/24
method: trust
# logs
pgpool_log_hostname: 'on'
pgpool_log_statement: 'on'
pgpool_log_per_node_statement: 'on'
pgpool_log_min_messages: info
pgpool_syslog_facility: LOCAL1
# connection_cache
pgpool_connection_cache: 'on'
# Pool
pgpool_num_init_children: 32
pgpool_max_pool: 4
pgpool_serialize_accept: 'off'
pgpool_child_life_time: 0
pgpool_child_max_connections: 0
pgpool_connection_life_time: 0
pgpool_client_idle_limit: 300
# load-balancing
pgpool_load_balance_mode: 'on'
pgpool_disable_load_balance_on_write: 'transaction' # one of 'transaction', 'trans_transaction' or 'always'
pgpool_statement_level_load_balance: 'on'
# running mode
pgpool_sr_check_user: repmgr
pgpool_sr_check_database: repmgr
pgpool_follow_master_command: "{{ pgpool_home_directory }}/follow_master.sh %d %h %p %D %m %H %M %P %r %R %N %S"
# HEALTH CHECK GLOBAL PARAMETERS
pgpool_health_check_period: 10
pgpool_health_check_timeout: 20
pgpool_health_check_user: repmgr
pgpool_health_check_database: repmgr
pgpool_health_check_max_retries: 3
pgpool_health_check_retry_delay: 10
pgpool_connect_timeout: 10000
# FAILOVER AND FAILBACK
pgpool_failover_command: "{{ pgpool_home_directory }}/failover.sh %d %h %p %D %m %H %M %P %r %R %N %S"
pgpool_failover_on_backend_error: 'off'
pgpool_auto_failback: 'on'
# Watchdog
pgpool_delegate_IP: 192.168.56.30
pgpool_use_watchdog: 'on'
pgpool_if_up_cmd: /usr/bin/sudo {{ pgpool_if_cmd_path }}/ip addr add $_IP_$/24 dev eth1 label eth1:0
pgpool_if_down_cmd: /usr/bin/sudo {{ pgpool_if_cmd_path }}/ip addr del $_IP_$/24 dev eth1
pgpool_arping_cmd: /usr/bin/sudo {{ pgpool_arping_path }}/arping -U $_IP_$ -w 1 -I eth1
# Online Recovery
pgpool_recovery_user: postgres
pgpool_recovery_password: ''
pgpool_recovery_1st_stage_command: recovery_1st_stage.sh
pgpool_recovery_2nd_stage_command: ''
pgpool_recovery_timeout: 90
pgpool_client_idle_limit_in_recovery: 0