Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
As creators, developers and maintainers of Barman, we really thank you for this great tutorial. Very well done!
What to do when i have 3 Amazon instance EC2 in which every instance has ‘centos’ username with secure-key by default.
Hi!
Thank you for a very nice tutorial. I have a small problem. I’m trying to use incremental backup reuse_backup = link, but it doesn’t work.
Configuration
[barman] barman_home = /backup/barman
barman_user = barman log_file = /var/log/barman/barman.log compression = gzip reuse_backup = link
immediate_checkpoint = true
basebackup_retry_times = 3 basebackup_retry_sleep = 30 last_backup_maximum_age = 1 DAYS
configuration_files_directory = /etc/barman/conf.d
[db.server.local] description = “db.server.local server backup” ssh_command = ssh postgres@db.server.local conninfo = host=db.server.local user=barman dbname=postgres retention_policy_mode = auto retention_policy = RECOVERY WINDOW OF 1 MONTH wal_retention_policy = main
barman list-backup db.server.local db.server.local 20160325T151000 - Fri Mar 25 15:12:17 2016 - Size: 16.9 GiB - WAL Size: 0 B db.server.local 20160325T150322 - Fri Mar 25 15:05:44 2016 - Size: 16.9 GiB - WAL Size: 410.6 KiB db.server.local 20160324T233002 - Thu Mar 24 23:32:24 2016 - Size: 16.9 GiB - WAL Size: 240.6 MiB db.server.local 20160324T135916 - Thu Mar 24 14:02:29 2016 - Size: 16.9 GiB - WAL Size: 208.0 MiB db.server.local 20160324T135447 - Thu Mar 24 13:57:17 2016 - Size: 16.9 GiB - WAL Size: 32.0 MiB db.server.local 20160324T124245 - Thu Mar 24 12:45:00 2016 - Size: 16.8 GiB - WAL Size: 80.0 MiB
barman show-backup db.server.local 20160325T151000 Backup 20160325T151000: Server Name : db.server.local Status : DONE PostgreSQL Version: 90405 PGDATA directory : /pgdata/9.4/main
Base backup information: Disk usage : 16.9 GiB Timeline : 1 Begin WAL : 00000001000000050000005E End WAL : 00000001000000050000005E WAL number : 1 Begin time : 2016-03-25 15:10:00.864661 End time : 2016-03-25 15:12:17.171181 Begin Offset : 40 End Offset : 1041680 Begin XLOG : 5/5E000028 End XLOG : 5/5E0FE510
WAL information: No of files : 0 Disk usage : 0 B Last available : 00000001000000050000005E
Catalog information: Retention Policy: VALID Previous Backup : 20160325T150322 Next Backup : - (this is the latest base backup)
Any idea what could be wrong?
Thanks, Indrek
barman@pg01-VirtualBox:/root$ barman show-backup main 20161003T121716 Backup 20161003T121716: Server Name : main Status : STARTED EXCEPTION: ‘children_timelines’ See log file for more details.
When trying for the first backup via below command:- barman backup main getting above error in logs as well:-
2016-10-03 12:23:49,908 [2959] barman.cli ERROR: ‘children_timelines’ See log file for more details. Traceback (most recent call last): File “/usr/lib/python2.7/dist-packages/barman/cli.py”, line 1022, in main p.dispatch(pre_call=global_config) File “/usr/lib/python2.7/dist-packages/argh/helpers.py”, line 55, in dispatch return dispatch(self, *args, **kwargs) File “/usr/lib/python2.7/dist-packages/argh/dispatching.py”, line 174, in dispatch for line in lines: File “/usr/lib/python2.7/dist-packages/argh/dispatching.py”, line 277, in _execute_command for line in result: File “/usr/lib/python2.7/dist-packages/argh/dispatching.py”, line 231, in _call result = function(namespace_obj) File “/usr/lib/python2.7/dist-packages/barman/cli.py”, line 539, in show_backup server.show_backup(backup_info) File “/usr/lib/python2.7/dist-packages/barman/server.py”, line 1688, in show_backup output.result(‘show_backup’, backup_ext_info) File “/usr/lib/python2.7/dist-packages/barman/output.py”, line 254, in result _dispatch(_writer, ‘result’, command, *args, **kwargs) File “/usr/lib/python2.7/dist-packages/barman/output.py”, line 127, in _dispatch return handler(*args, **kwargs) File “/usr/lib/python2.7/dist-packages/barman/output.py”, line 659, in result_show_backup if data[‘children_timelines’]: KeyError: ‘children_timelines’
Any suggestion , Thanks in advance
I have followed each and every step in this guide (checked it 4 or 6 times now) and when i run the ‘barman check’ command im getting the follwing WAL archive: FAILED (please make sure WAL shipping is setup) PostgreSQL: FAILED directories: OK retention policy settings: OK backup maximum age: FAILED (interval provided: 1 day, latest backup age: No available backups) compression settings: OK failed backups: OK (there are 0 failed backups) minimum redundancy requirements: OK (have 0 backups, expected at least 0) ssh: OK (PostgreSQL server) not in recovery: OK archiver errors: OK
I can SSH from my 2 postgresql servers to the barman server (using the command ssh barman@pgbarman01) and from barman to the 2 postgresql servers (ssh postgres@pgpoc01 and ssh postgres@pgpoc02).I am doing this in RHEL 7.3 (does this actually matter though?). I am also using servers that I have on premise at my work if that helps.
Please let me know thanks.
Why does barman say this:
IMPORTANT
These settings have been modified to prevent data losses
postgresql.conf line 207: archive_command = false
Also, in my case it also says the following:
WARNING
You are required to review the following options as potentially dangerous
postgresql.conf line 40: data_directory = '/var/lib/postgresql/9.5/main' # use data in another directory
postgresql.conf line 42: hba_file = '/etc/postgresql/9.5/main/pg_hba.conf' # host-based authentication file
postgresql.conf line 44: ident_file = '/etc/postgresql/9.5/main/pg_ident.conf' # ident configuration file
postgresql.conf line 48: external_pid_file = '/var/run/postgresql/9.5-main.pid' # write an extra PID file
postgresql.conf line 85: ssl_cert_file = '/etc/ssl/certs/ssl-cert-snakeoil.pem' # (change requires restart)
postgresql.conf line 86: ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires restart)
It appears that barman attempts to create a new postgresql.conf file in the data directory. Although in my case (using Ubuntu 14 LTS) the postgresql.conf file lives in /etc/postgresql/9.5/ …
Hi, I’m having an issue executing the following command, to make a remote recover:
barman recover --target-time '2017-03-15 16:30:02.638819-03:00' --remote-ssh-command 'ssh postgres@backup_ip_server' master_server 20170315T163002 /var/lib/pgsql/9.5/data
The output is:
Starting remote restore for server master_server using backup 20170315T163002 Destination directory: /var/lib/pgsql/9.5/data Doing PITR. Recovery target time: ‘2017-03-15 16:30:02.638819-03:00’ Using safe horizon time for smart rsync copy: 2017-03-15 16:30:02.638819-03:00 Copying the base backup. Generating recovery.conf ERROR: unable to create the archive_status directory ‘/var/lib/pgsql/9.5/data/pg_xlog/archive_status’: mkdir execution failed
Do I missed something ? If you need some other information (server status, check server, etc.) please let me know. Excellent tutorial btw ! I haven’t found another like this one, but sadly I’m stuck in the final step.
Hey thanks for the detailed tutorial.
I had one small question though. Why do you use “Begin time” instead of “End time” for --target-time during the barman recover command? Does barman time stamp backups by start time and only uses “End time” for display purposes?
You would think that you would want to use the “End time” because it is the latest on the time spectrum. Anyways thanks again for the solid tutorial.
Regards,
Aidan
Very Nice Blog , Could you please also create a blog for setting barman using pg_receivexlog / streaming protocol .