
Filtre actif, cliquez pour en enlever un tag :
Cliquez sur un tag pour affiner votre recherche :
Résultat de la recherche (1 notes) :
Journal du jeudi 13 février 2025 à 14:50
Suite à ce commentaire et celui-ci, je m'adresse dans cette note à Anarcat (francophone) et Martín Marqués pour expliquer ce que j'essaie de faire dans le POC https://github.com/stephane-klein/poc-barman, ce que j'ai réussi à faire et présenter aussi mes difficultés.
J'ai traduit cette note en anglais et je l'ai postée sur "GitHub Barman discussion" : https://github.com/EnterpriseDB/barman/discussions/1067.
Mon objectif dans le repository poc-barman
est d'essayer d'utiliser barman dans un container Docker sidecar pour sauvegarder un container PostgreSQL.
Une de mes contraintes est d'effectuer un minimum de changements au niveau du container PostgreSQL que je souhaite sauvegarder. Je souhaite pouvoir utiliser une image Docker PostgreSQL mainstream https://hub.docker.com/_/postgres, sans changement.
Je souhaite utiliser le mode de sauvegarde de barman nommé streaming backups method
: backup_method = postgres
qui se base sur la commande pg_basebackup
(commande officielle intégrée à PostgreSQL).
Je souhaite utiliser la nouvelle fonctionnalité pg_basebackup --incremental...
de la version 17 de PostgreSQL.
Voici ma configuration de barman : https://github.com/stephane-klein/poc-barman/blob/4df58ecc5af6d2d1f7607c364400f8c5ba012496/docker-compose.yml#L15
Et voici ma configuration de PostgreSQL 17 :
- https://github.com/stephane-klein/poc-barman/blob/4df58ecc5af6d2d1f7607c364400f8c5ba012496/docker-compose.yml#L15
- et https://github.com/stephane-klein/poc-barman/blob/4df58ecc5af6d2d1f7607c364400f8c5ba012496/init-barman.sh#L1
J'ai implémenté un script nommé ./scripts/reset.sh
qui effectue un test de bout automatiquement.
Voici son screencast :
Voici ce qu'il fait :
- Il coupe tous les containers et efface les volumes
- Il lance les containers
postgres1
etbarman
et injecte quelques données danspostgres1
- Il initialise
barman
- Il effectue une sauvegarde complète de
postgres1
- Il restaure la sauvegarde vers
postgres2
et lancepostgres2
et affiche les données de la tabledummy
- Il effectue une sauvegarde incrémentielle après avoir injecté quelques nouvelles données dans
postgres1
- Il restaure la sauvegarde de
postgres1
en utilisantpg_combinebackup
verspostgres2
préalablement coupé et effacé - Ici j'ai un échec au lancement de
postgres2
basé sur la restauration de la sauvegarde incrémentielle
Questions que je me pose :
- Pourquoi la restauration basée sur la sauvegarde incrémentielle échoue ?
- Est-ce que mon scénario de test d'usage de barman est correct, est-ce qu'il me manque des étapes ou est-ce que je fais des opérations non nécessaires ?
- Est-ce que j'ai fait des erreurs importantes ?
Voici ci-dessous la version anglaise posté ici.
Subject: Streaming Incremental Backup Configuration with PostgreSQL 17 using Docker Sidecar
Hello,
In the poc-barman
repository, I'm trying to use barman in a Docker sidecar container to backup a PostgreSQL container.
One of my constraints is to make minimal changes to the PostgreSQL container that I want to backup. I want to be able to use a mainstream Docker PostgreSQL image https://hub.docker.com/_/postgres, without modifications.
I want to use the barman backup mode called streaming backups method
: backup_method = postgres
which is based on the pg_basebackup
command (official command integrated into PostgreSQL).
I want to use the new pg_basebackup --incremental...
feature from PostgreSQL version 17.
Here is my barman configuration: https://github.com/stephane-klein/poc-barman/blob/4df58ecc5af6d2d1f7607c364400f8c5ba012496/docker-compose.yml#L15
And here is my PostgreSQL 17 configuration:
- https://github.com/stephane-klein/poc-barman/blob/4df58ecc5af6d2d1f7607c364400f8c5ba012496/docker-compose.yml#L15
- and https://github.com/stephane-klein/poc-barman/blob/4df58ecc5af6d2d1f7607c364400f8c5ba012496/init-barman.sh#L1
I implemented a script called ./scripts/reset.sh
that performs an end-to-end test automatically.
Here's its screencast:
Here's what it does:
- It stops all containers and erases the volumes
- It starts the
postgres1
andbarman
containers and injects some data intopostgres1
- It initializes
barman
- It performs a full backup of
postgres1
- It restores the backup to
postgres2
, startspostgres2
, and displays the data from thedummy
table - It performs an incremental backup after injecting some new data into
postgres1
- It restores
postgres1
backup usingpg_combinebackup
topostgres2
which was previously stopped and erased - Here I have a failure when starting
postgres2
based on the incremental backup restoration
Questions:
- Why does the restoration based on the incremental backup fail?
- Is my barman usage test scenario correct, am I missing steps or am I performing unnecessary operations?
- Have I made any significant mistakes?
Best regards,
Stephane
Dernière page.