-
Notifications
You must be signed in to change notification settings - Fork 13
/
main.yml
304 lines (278 loc) · 8.99 KB
/
main.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
---
# apt installation settings
pgpool_apt_install: yes
pgpool_apt_key_id: "ACCC4CF8"
pgpool_apt_key_url: "https://www.postgresql.org/media/keys/ACCC4CF8.asc"
pgpool_apt_repository: "deb http://apt.postgresql.org/pub/repos/apt/ {{ ansible_distribution_release }}-pgdg main {{ pgpool_postgresql_version }}"
pgpool_apt_archive_repositories:
- "deb https://apt-archive.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg-archive main"
- "deb-src https://apt-archive.postgresql.org/pub/repos/apt {{ ansible_distribution_release }}-pgdg-archive main"
pgpool_apt_pin_priority: 500
pgpool_apt_dependencies:
- postgresql-client-{{ pgpool_postgresql_version }}
- postgresql-client-common
- arping
pgpool_extensions:
- pgpool_recovery
- pgpool_adm
# Set this variable if you want to install a specific version list in the apt repositories
# Example : 4.1.4-6.pgdg110+1
# pgpool_version_debian: ''
# postgresql related variables
# The major version of your pgpool backends
# See follow_master and recovery_1st_stage bash scripts
pgpool_postgresql_version: 13
pgpool_postgresql_cluster_name: main
pgpool_postgresql_service_user: postgres
pgpool_postgresql_service_group: postgres
pgpool_postgresql_home_directory: /var/lib/postgresql
pgpool_postgresql_data_directory: "{{ pgpool_postgresql_home_directory }}/{{ pgpool_postgresql_version }}/{{ pgpool_postgresql_cluster_name }}"
pgpool_postgres_password_cleartext: postgres
# systemd
pgpool_systemd_state: started
pgpool_systemd_enabled: yes
# logrotate
pgpool_logrotate_cron_enabled: yes
pgpool_logrotate_cron_schedule:
minute: '*'
hour: '1'
# pgpool user
pgpool_home_directory: /etc/pgpool2
pgpool_group: pgpool
pgpool_user: pgpool
pgpool_password_cleartext: pgpool
# .pgpass file
pgpool_pgpass_entries: []
# pgpool_pgpass_entries:
# - hostname: server01
# port: 5432
# database: repmgr
# user: repmgr
# password: repmgr
# .pcpass file
pgpool_pcppass_entries:
- hostname: localhost
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 file
pgpool_passwd_use_md5: yes
pgpool_passwd_users_md5:
- username: pgpool
password: pgpool
# pgpool Connection Settings
pgpool_listen_addresses: '*'
pgpool_port: 9999
pgpool_socket_dir: /var/run/pgpool
pgpool_listen_backlog_multiplier: 2
pgpool_serialize_accept: 'off'
pgpool_reserved_connections: 0
# pgpool Communication Manager Connection Settings
pgpool_pcp_listen_addresses: '*'
pgpool_pcp_port: 9898
pgpool_pcp_socket_dir: /var/run/pcp
# Backend Connection Settings
pgpool_backend_servers:
- hostname: localhost
port: 5432
weight: 1
data_directory: /var/lib/pgsql/data
flag: ALLOW_TO_FAILOVER
application_name: server0
# Authentication
pgpool_enable_pool_hba: off
pgpool_pool_hba_entries: []
# pgpool_pool_hba_entries:
# - type: host
# database: all
# user: admin
# address: 192.168.0.0/16
# method: trust
pgpool_pool_passwd: pool_passwd
pgpool_authentication_timeout: 60
pgpool_allow_clear_text_frontend_auth: 'on'
# SSL Connections
pgpool_ssl: off
pgpool_ssl_key: ./server.key
pgpool_ssl_cert: ./server.cert
pgpool_ssl_ca_cert: ''
pgpool_ssl_ca_cert_dir: ''
pgpool_ssl_ciphers: HIGH:MEDIUM:+3DES:!aNULL
pgpool_ssl_prefer_server_ciphers: 'off'
pgpool_ssl_ecdh_curve: prime256v1
pgpool_ssl_dh_params_file: ''
# POOLS
# Concurrent session and pool size
pgpool_num_init_children: 32
pgpool_max_pool: 4
# Life time
pgpool_child_life_time: 300
pgpool_child_max_connections: 0
pgpool_connection_life_time: 0
pgpool_client_idle_limit: 0
# LOGS
# Where to log
pgpool_log_destination: syslog
# What to log
pgpool_log_connections: 'off'
pgpool_log_hostname: 'off'
pgpool_log_statement: 'off'
pgpool_log_per_node_statement: 'off'
pgpool_log_client_messages: 'off'
pgpool_log_standby_delay: none # one of 'always', 'if_over_threshold', 'none'
# Syslog specific
pgpool_syslog_facility: LOCAL0
pgpool_syslog_ident: pgpool
# Debug
pgpool_log_error_verbosity: default
pgpool_client_min_messages: notice
pgpool_log_min_messages: warning
# FILE LOCATIONS
pgpool_logdir: /var/log/pgpool
pgpool_pid_file_name: /var/run/pgpool/pgpool.pid
# CONNECTION POOLING
pgpool_connection_cache: 'off'
pgpool_reset_query_list: ABORT; DISCARD ALL
# REPLICATION MODE
pgpool_replication_mode: 'off'
pgpool_replicate_select: 'off'
pgpool_insert_lock: 'on'
pgpool_lobj_lock_table: ''
# Degenerate handling
pgpool_replication_stop_on_mismatch: 'off'
pgpool_failover_if_affected_tuples_mismatch: 'off'
# LOAD BALANCING MODE
pgpool_load_balance_mode: 'off'
pgpool_ignore_leading_white_space: 'on'
pgpool_white_function_list: ''
pgpool_black_function_list: currval,lastval,nextval,setval
pgpool_black_query_pattern_list: ''
pgpool_database_redirect_preference_list: ''
pgpool_app_name_redirect_preference_list: ''
pgpool_allow_sql_comments: 'off'
pgpool_disable_load_balance_on_write: 'transaction' # one of 'transaction', 'trans_transaction' or 'always'
pgpool_statement_level_load_balance: 'off'
# MASTER/SLAVE MODE (alias pgpool running mode)
pgpool_master_slave_mode: 'on'
pgpool_master_slave_sub_mode: stream
# Streaming
pgpool_sr_check_period: 10
pgpool_sr_check_user: 'nobody'
pgpool_sr_check_password: ''
pgpool_sr_check_database: ''
pgpool_delay_threshold: 10000000
# Special commands
pgpool_follow_master_template: scripts/follow_master.repmgr.sh.j2
pgpool_follow_master_command:
# HEALTH CHECK GLOBAL PARAMETERS
pgpool_health_check_period: 0
pgpool_health_check_timeout: 20
pgpool_health_check_user: nobody
pgpool_health_check_password: ''
pgpool_health_check_database: ''
pgpool_health_check_max_retries: 0
pgpool_health_check_retry_delay: 1
pgpool_connect_timeout: 10000
# HEALTH CHECK PER NODE PARAMETERS (OPTIONAL)
# TODO
# FAILOVER AND FAILBACK
pgpool_failover_template: scripts/failover.repmgr.sh.j2
pgpool_failover_command: ''
pgpool_failback_command: ''
pgpool_failover_on_backend_error: 'on'
pgpool_detach_false_primary: 'off'
pgpool_search_primary_node_timeout: 300
pgpool_auto_failback: 'off'
pgpool_auto_failback_interval: 60
# ONLINE RECOVERY
pgpool_remote_start_template: scripts/pgpool_remote_start.j2
pgpool_recovery_1st_stage_template: scripts/recovery_1st_stage.repmgr.sh.j2
pgpool_recovery_user: nobody
pgpool_recovery_password: ''
pgpool_recovery_1st_stage_command: ''
pgpool_recovery_2nd_stage_command: ''
pgpool_recovery_timeout: 90
pgpool_client_idle_limit_in_recovery: 0
# WATCHDOG
# Enabling
pgpool_use_watchdog: 'off'
# Connection to up stream servers
pgpool_trusted_servers: ''
ppgool_ping_path: '' # Varies with OS. Defined in vars/
# Watchdog communication Settings
pgpool_wd_hostname: ''
pgpool_wd_port: 9000
pgpool_wd_priority: 1
pgpool_authkey: ''
pgpool_wd_ipc_socket_dir: /var/run/watchdog
# Virtual IP control Setting
pgpool_delegate_IP: ''
pgpool_if_cmd_path: '' # Varies with OS. Defined in vars/
pgpool_if_up_cmd: /usr/bin/sudo {{ pgpool_if_cmd_path }}/ip addr add $_IP_$/24 dev eth0 label eth0:0
pgpool_if_down_cmd: /usr/bin/sudo {{ pgpool_if_cmd_path }}/ip addr del $_IP_$/24 dev eth0
pgpool_arping_path: '' # Varies with OS. Defined in vars/
pgpool_arping_cmd: /usr/bin/sudo {{ pgpool_arping_path }}/arping -U $_IP_$ -w 1 -I eth0
# Behavior on escalation Setting
pgpool_clear_memqcache_on_escalation: 'on'
pgpool_wd_escalation_command: ''
pgpool_wd_de_escalation_command: ''
# Watchdog consensus settings for failover
pgpool_failover_when_quorum_exists: 'on'
pgpool_failover_require_consensus: 'on'
pgpool_allow_multiple_failover_requests_from_node: 'off'
pgpool_enable_consensus_with_half_votes: 'off'
# Lifecheck Setting
# common
pgpool_wd_monitoring_interfaces_list: ''
pgpool_wd_lifecheck_method: 'heartbeat'
pgpool_wd_interval: 10
# heartbeat mode
pgpool_wd_heartbeat_port: 9694
pgpool_wd_heartbeat_keepalive: 2
pgpool_wd_heartbeat_deadtime: 30
pgpool_heartbeat_destination: []
# pgpool_heartbeat_destination:
# - hostname: host0_ip1
# port: 9694
# device: ''
# query mode
pgpool_wd_life_point: 3
pgpool_wd_lifecheck_query: SELECT 1
pgpool_wd_lifecheck_dbname: template1
pgpool_wd_lifecheck_user: nobody
pgpool_wd_lifecheck_password: ''
# Other pgpool Connection Settings
pgpool_other_settings: []
# pgpool_other_settings:
# - hostname: server0
# port: 9999
# wd_port: 9000
# OTHERS
pgpool_relcache_expire: 0
pgpool_relcache_size: 256
pgpool_check_temp_table: catalog
pgpool_check_unlogged_table: 'on'
pgpool_enable_shared_relcache: 'on'
pgpool_relcache_query_target: master
# IN MEMORY QUERY MEMORY CACHE
pgpool_in_memory_query_cache: 'off'
pgpool_memqcache_method: shmem
pgpool_memqcache_memcached_host: localhost
pgpool_memqcache_memcached_port: 11211
pgpool_memqcache_total_size: 67108864
pgpool_memqcache_max_num_cache: 1000000
pgpool_memqcache_expire: 0
pgpool_memqcache_auto_cache_invalidation: 'on'
pgpool_memqcache_maxcache: 409600
pgpool_memqcache_cache_block_size: 1048576
pgpool_memqcache_oiddir: /var/log/pgpool/oiddir
pgpool_white_memqcache_table_list: ''
pgpool_black_memqcache_table_list: ''