Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can`t restore a backup #909

Open
Vsevosemnog opened this issue Apr 25, 2023 · 1 comment
Open

Can`t restore a backup #909

Vsevosemnog opened this issue Apr 25, 2023 · 1 comment

Comments

@Vsevosemnog
Copy link

Vsevosemnog commented Apr 25, 2023

https://talk.stolon.io/t/can-t-restore-cluster-with-backup-pg-basebackup/255

Good day, need some help

Made a backup with the help of pg_basebackup

pg_basebackup --format=tar --verbose --write-recovery-conf --wal-method=stream 
 --gzip --compress=5 --host=$BACKUP_POSTGRES_HOST --port=$BACKUP_POSTGRES_PORT --username=$BACKUP_POSTGRES_USER \
 -D $outputfile

Could restore in in docker postgres but can`t restore in stolon clsuter in kubernetes

stolonctl version
0.17.0

The backup is located in /tmp/backup/, wal archive too

I tried different variants of stolonctl init, but they doesn`t work

stolonctl init '{ "initMode": "pitr", "pitrConfig": { "dataRestoreCommand": "tar -xzvf /tmp/backup/base.tar.gz -C %d" , "archiveRecoverySettings": { "restoreCommand": "cp /tmp/backup/pg_wal/%f %p" }, "recoveryTargetSettings": {"recoveryTarget": "immediate", "recoveryTargetAction":"promote"} } }' --cluster-name=stolon-dev --store-backend=kubernetes --kube-resource-kind=configmap

sentinel says

waiting for db to converge    {"db": "5d855218", "keeper": "keeper0"}

proxy says

no db object available, closing connections to master    {"db": ""}

keeper says

archive recovery complete
cp: cannot stat '/tmp/backup/pg_wal/00000001.history': No such file or directory
database system is ready to accept connections

after that postgres doesn`t respond
what did i do wrong?
image

@Vsevosemnog
Copy link
Author

Found out that if i delete recovery.signal file
everything is okay and restoration is done.

Why so? I even gave “recoveryTargetAction” parameter in init command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant