Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
postgresql_pgbackrest_configuration [2025/05/17 15:24] – andonovj | postgresql_pgbackrest_configuration [2025/05/19 06:22] (current) – [Restore] andonovj | ||
---|---|---|---|
Line 15: | Line 15: | ||
</ | </ | ||
- | So in nutshell, my patroni.yml looks like this: | ||
- | < | + | After that, you can configure the / |
- | scope: stampede | + | |
- | name: ${host} | + | |
- | + | ||
- | restapi: | + | |
- | listen: ${host}: | + | |
- | connect_address: | + | |
- | + | ||
- | etcd: | + | |
- | hosts: etcd00:2379, etcd01: | + | |
- | + | ||
- | bootstrap: | + | |
- | dcs: | + | |
- | ttl: 30 | + | |
- | loop_wait: 10 | + | |
- | retry_timeout: | + | |
- | maximum_lag_on_failover: | + | |
- | maximum_lag_on_syncnode: | + | |
- | synchronous_mode: | + | |
- | postgresql: | + | |
- | use_pg_rewind: | + | |
- | use_slots: true | + | |
- | initdb: | + | <Code:bash|Pgbackrest Configuration> |
- | - encoding: UTF8 | + | [global] |
- | - data-checksums | + | repo1-path=/ |
+ | repo1-retention-full=14 | ||
+ | repo1-retention-full-type=time | ||
+ | repo1-host-user=pgbackrest | ||
+ | archive-check=n | ||
+ | process-max=2 | ||
+ | log-level-console=info | ||
+ | log-path=/ | ||
+ | log-level-file=debug | ||
+ | start-fast=y (performs a checkpoint) | ||
+ | delta=y | ||
- | pg_hba: | + | [cluster_backup] |
- | - host replication rep_user ${subnet}.0/ | + | pg1-path=/ |
- | - host all all ${subnet}.0/ | + | |
- | + | ||
- | postgresql: | + | |
- | listen: ${host}: | + | |
- | connect_address: | + | |
- | data_dir: | + | |
- | bin_dir: ${bindir} | + | |
- | pgpass: / | + | |
- | authentication: | + | |
- | replication: | + | |
- | username: rep_user | + | |
- | password: newpass | + | |
- | superuser: | + | |
- | username: postgres | + | |
- | password: newpass | + | |
- | parameters: | + | |
- | unix_socket_directories: | + | |
- | external_pid_file: | + | |
- | logging_collector: | + | |
- | log_directory: | + | |
- | log_filename: | + | |
- | shared_buffers: | + | |
- | work_mem: 16MB | + | |
- | maintenance_work_mem: | + | |
- | max_worker_processes: | + | |
- | wal_buffers: | + | |
- | max_wal_size: | + | |
- | min_wal_size: | + | |
- | effective_cache_size: | + | |
- | fsync: on | + | |
- | checkpoint_completion_target: | + | |
- | log_rotation_size: | + | |
- | listen_addresses: | + | |
- | max_connections: | + | |
- | temp_buffers: | + | |
- | archive_mode: | + | |
- | wal_level: " | + | |
- | archive_command: | + | |
- | restore_command: | + | |
</ | </ | ||
Line 173: | Line 122: | ||
Check if that is the correct state and if you are happy. Then promote it and THEN stop it: | Check if that is the correct state and if you are happy. Then promote it and THEN stop it: | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
< | < | ||
Line 188: | Line 141: | ||
That is how I was able to make it work. I am 99.(9)8% (Math nerds here), sure I do something wrong, but still. If you cannot get it work with patroni initially, that way works. | That is how I was able to make it work. I am 99.(9)8% (Math nerds here), sure I do something wrong, but still. If you cannot get it work with patroni initially, that way works. | ||
- | |||
- | =====Appendix===== | ||
- | Configuration for pgbackrest on ALL servers: | ||
- | |||
- | < | ||
- | [global] | ||
- | repo1-path=/ | ||
- | repo1-retention-full=14 | ||
- | repo1-retention-full-type=time | ||
- | repo1-host-user=pgbackrest | ||
- | archive-check=n | ||
- | process-max=2 | ||
- | log-level-console=info | ||
- | log-path=/ | ||
- | log-level-file=debug | ||
- | start-fast=y (performs a checkpoint) | ||
- | delta=y | ||
- | |||
- | [cluster_backup] | ||
- | pg1-path=/ | ||
- | </ | ||
- | |||
- | FYI: https:// | ||