Alright barman 1.3.3 is released, let me try again, but now with a fresh DB
Hint: it fails after I try to restart db on main for recovery, what am I missing??
'm' is main db server
'b' is main db backup server (where barman is installed)
......................................................................................................
m0. start fresh barman 1.3.3
m1. service postgresql-9.3 initdb (main)
m2. restored pg_hba & postgresql.conf (main)
m3. start db (main) [OK]
......................................................................................................
b0. barman -v -> 1.3.3
b1. barman check main
Server main:
ssh: OK
PostgreSQL: OK
archive_mode: OK
archive_command: OK
directories: OK
retention policy settings: OK
backup maximum age: OK (no last_backup_maximum_age provided)
compression settings: OK
minimum redundancy requirements: OK (have 0 backups, expected at least 0)
b2. barman status main
Server main:
Description: Main PostgreSQL Database
PostgreSQL version: 9.3.5
pgespresso extension: Not available
PostgreSQL Data directory: /var/lib/pgsql/9.3/data
PostgreSQL 'archive_command' setting: rsync -a %p bar...@opentunnel-db-standby.lan:/var/lib/barman/opentunnel-db-standby.lan/incoming/%f
Archive status: last shipped WAL segment None
Current WAL segment: 000000010000000000000001
Retention policies: not enforced
No. of available backups: 0
First available backup: None
Last available backup: None
Minimum redundancy requirements: satisfied (0/0)
b3. barman diagnose
{
"global": {
"config": {
"barman_home": "/var/lib/barman",
"barman_user": "barman",
"configuration_files_directory": "/etc/barman.d/",
"log_file": "/var/log/barman/barman.log"
},
"system_info": {
"barman_ver": "1.3.3",
"kernel_ver": "Linux opentunnel-db-standby.lan 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux",
"python_ver": "Python 2.6.6",
"release": "RedHat Linux CentOS release 6.5 (Final)",
"rsync_ver": "rsync version 3.0.6 protocol version 30",
"ssh_ver": "OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013"
}
},
"servers": {
"main": {
"backups": {},
"config": {
"active": true,
"backup_directory": "/var/lib/barman/main",
"backup_options": "exclusive_backup",
"bandwidth_limit": null,
"barman_home": "/var/lib/barman",
"basebackup_retry_sleep": 30,
"basebackup_retry_times": 0,
"basebackups_directory": "/var/lib/barman/main/base",
"compression": null,
"conninfo": "host=opentunnel-db.lan user=postgres",
"custom_compression_filter": null,
"custom_decompression_filter": null,
"description": "Main PostgreSQL Database",
"immediate_checkpoint": false,
"incoming_wals_directory": "/var/lib/barman/main/incoming",
"last_backup_maximum_age": null,
"lock_file": "/var/lib/barman/main/main.lock",
"minimum_redundancy": 0,
"name": "main",
"network_compression": false,
"post_archive_script": null,
"post_backup_script": null,
"pre_archive_script": null,
"pre_backup_script": null,
"retention_policy": null,
"retention_policy_mode": "auto",
"ssh_command": "ssh post...@opentunnel-db.lan",
"tablespace_bandwidth_limit": null,
"wal_retention_policy": "main",
"wals_directory": "/var/lib/barman/main/wals"
},
"status": {
"archive_command": "rsync -a %p bar...@opentunnel-db-standby.lan:/var/lib/barman/opentunnel-db-standby.lan/incoming/%f",
"archive_mode": "on",
"config_file": "/var/lib/pgsql/9.3/data/postgresql.conf",
"current_xlog": "000000010000000000000001",
"data_directory": "/var/lib/pgsql/9.3/data",
"hba_file": "/var/lib/pgsql/9.3/data/pg_hba.conf",
"ident_file": "/var/lib/pgsql/9.3/data/pg_ident.conf",
"last_shipped_wal": null,
"pgespresso_installed": false,
"server_txt_version": "9.3.5"
},
"system_info": {
"kernel_ver": "Linux opentunnel-db.lan 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux",
"python_ver": "Python 2.6.6",
"release": "RedHat Linux CentOS release 6.5 (Final)",
"rsync_ver": "rsync version 3.0.6 protocol version 30",
"ssh_ver": "OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013"
}
}
}
}
......................................................................................................
All appears to be in order, continue
......................................................................................................
b4. barman backup main
Starting backup for server main in /var/lib/barman/main/base/20140827T154935
Backup start at xlog location: 0/2000028 (000000010000000000000002, 00000028)
Copying files.
Copy done.
Asking PostgreSQL server to finalize the backup.
Backup end at xlog location: 0/20000B8 (000000010000000000000002, 000000B8)
Backup completed
b5. barman list-backup main
main 20140827T154935 - Wed Aug 27 15:49:38 2014 - Size: 19.5 MiB - WAL Size: 0 B
......................................................................................................
Now the other important task, RECOVERY :)
......................................................................................................
b6. barman recover --remote-ssh-command "ssh post...@opentunnel-db.lan" main 20140827T154935 /opt/restored-backup/
Starting remote restore for server main using backup 20140827T154935
Destination directory: /opt/restored-backup/
Using safe horizon time for smart rsync copy: 2014-08-27 15:26:10.114553+02:00
Copying the base backup.
Copying required wal segments.
The archive_command was set to 'false' to prevent data losses.
Your PostgreSQL server has been successfully prepared for recovery!
Please review network and archive related settings in the PostgreSQL
configuration file before starting the just recovered instance.
......................................................................................................
back to our main server (let us see if we can restore/recover the database)
......................................................................................................
m4. First I stopped postgresql (because I need to change PGDATA to /opt/restored-backup/) in /etc/init.d/postgresql-9.3
and it must point to current DB files otherwise stopping fails.
m5. PGDATA=/opt/restored-backup/ (in /etc/init.d/postgresql-9.3) also adjust PGLOG
m6. /opt/restored-backup/ privileges are postgres:postgres so that is ok
m7. service postgresql-9.3 start
[FAIL] :-(
m8. cat /opt/restored-backup/pg_log/ postgresql-Wed.log
< 2014-08-27 16:19:23.051 CEST >LOG: database system was interrupted; last known up at 2014-08-27 15:49:36 CEST
< 2014-08-27 16:19:23.051 CEST >LOG: invalid checkpoint record
< 2014-08-27 16:19:23.051 CEST >FATAL: could not locate required checkpoint record
< 2014-08-27 16:19:23.051 CEST >HINT: If you are not restoring from a backup, try removing the file "/opt/restored-backup/backup_label".
< 2014-08-27 16:19:23.051 CEST >LOG: startup process (PID 3574) exited with exit code 1
< 2014-08-27 16:19:23.051 CEST >LOG: aborting startup due to startup process failure
So I renamed backup_label to
backup_label.org but of course this is not the issue
< 2014-08-27 16:21:16.303 CEST >LOG: database system was interrupted; last known up at 2014-08-27 15:49:36 CEST
< 2014-08-27 16:21:16.303 CEST >LOG: invalid primary checkpoint record
< 2014-08-27 16:21:16.303 CEST >LOG: invalid secondary checkpoint record
< 2014-08-27 16:21:16.303 CEST >PANIC: could not locate a valid checkpoint record
< 2014-08-27 16:21:16.303 CEST >LOG: startup process (PID 3626) was terminated by signal 6: Aborted
< 2014-08-27 16:21:16.303 CEST >LOG: aborting startup due to startup process failure
What am I doing wrong, I really puzzles me.
Thank you for your time.
Op vrijdag 15 augustus 2014 10:57:15 UTC+2 schreef patman:
#archive_command = 'rsync -a %p barman@opentunnel-db-standby.lan:/var/lib/barman/opentunnel-db-standby.lan/incoming/%f'