2024-05-26 15:11:53 +00:00
|
|
|
# Deploy Patroni
|
|
|
|
|
|
|
|
## Supported features
|
|
|
|
- TLS
|
|
|
|
- Backups to S3 with WAL-G
|
|
|
|
- Deploy new cluster from S3
|
|
|
|
- Scheduled backups to S3
|
2023-08-11 10:51:51 +00:00
|
|
|
|
|
|
|
## Install ansible and requirements in virtualenv
|
|
|
|
|
|
|
|
mkvirtualenv ansible-7.6.0
|
|
|
|
pip install -r requirements.txt
|
|
|
|
deactivate
|
|
|
|
workon ansible-7.6.0
|
|
|
|
|
|
|
|
## Install roles
|
|
|
|
|
|
|
|
ansible-playbook ansible-roles.yaml
|
|
|
|
|
|
|
|
## Install Patroni
|
|
|
|
|
|
|
|
ansible-playbook -i inventory/hosts patroni.yaml -u almalinux
|
|
|
|
|
|
|
|
## Patroni options example
|
|
|
|
|
|
|
|
patroni_postgresql_dynamic_parameters:
|
|
|
|
postgresql:
|
|
|
|
parameters:
|
|
|
|
max_connections: '2000'
|
|
|
|
|
|
|
|
## Backup options example
|
|
|
|
|
|
|
|
patroni_wal_g_install: true
|
|
|
|
wal_g_config: >-
|
|
|
|
{{
|
|
|
|
{
|
|
|
|
"AWS_ACCESS_KEY_ID": "YOUR_ACCESS_KEY_ID",
|
|
|
|
"AWS_SECRET_ACCESS_KEY": "YOUR_SECRET_ACCESS_KEY",
|
|
|
|
"AWS_ENDPOINT": "https://s3.amazon.com",
|
|
|
|
"WALG_S3_PREFIX": "s3://wal-g/patroni-1",
|
2024-06-16 18:55:41 +00:00
|
|
|
"WALG_LIBSODIUM_KEY": "29b43e2f46adcaf9f0d635d9fe4934e3227b3cbd13e2b19c7b28c16a581cc15c",
|
2023-08-11 10:51:51 +00:00
|
|
|
"AWS_S3_FORCE_PATH_STYLE": "true"
|
|
|
|
}
|
|
|
|
}}
|