Problem when generating remote backup

197 views
Skip to first unread message

Eurides Baptistella

unread,
Jul 10, 2013, 3:10:20 PM7/10/13
to pgba...@googlegroups.com
I have a problem! I am not knowing how to use the Barman
Performed the installation and configuration on a OpenSuse 12.2 with PostgreSQL 9.2 and 1.2.2 Barman.

I am attempting to generate a remote backup, server 192.168.30.237 (Barman) to 192.168.30.37 (PostgreSQL Master).
Problem:
- I can not find the backup compressed;
- Failed to perform the restore.
- Backups generated with 0kb

I know that the information is not accurate, but I would like some help from the experts.
Follows some information
--------------------------------------------------------------------------------
barman@srv-backup:/sysmo/barman> barman list-server
main - Servidor Principal

barman@srv-backup:/sysmo/barman> barman check main
Server main:
        ssh: OK
        PostgreSQL: OK
        archive_mode: OK
        archive_command: OK
        directories: OK
        retention policy settings: OK
        compression settings: OK
        minimum redundancy requirements: OK (have 3 backups, expected at least 0)
       
barman@srv-backup:/sysmo/barman> barman status main
Server main:
        description: Servidor Principal
        PostgreSQL version: 9.2.3
        PostgreSQL Data directory: /sysmo/sysmovs/dados/pgsql/data
        archive_command: rsync -a %p bar...@192.168.30.237:/sysmo/barman/test/%f
        archive_status: last shipped WAL segment 000000010000000A000000A2
        current_xlog: 000000010000000A000000A3
        Retention policies: not enforced
        No. of available backups: 3
        first available backup: 20130710T151536
        last available backup: 20130710T151737

--------------------------------------------------------------------------------
barman@srv-backup:/sysmo/barman> barman show-server main
Server main:
        active: true
        description: Servidor Principal
        ssh_command: ssh post...@192.168.30.37
        conninfo: host=192.168.30.37 user=postgres
        backup_directory: /sysmo/barman/main
        basebackups_directory: /sysmo/barman/main/base
        wals_directory: /sysmo/barman/main/wals
        incoming_wals_directory: /sysmo/barman/main/incoming
        lock_file: /sysmo/barman/main/main.lock
        compression: gzip
        custom_compression_filter: None
        custom_decompression_filter: None
        retention_policy_mode: auto
        retention_policy: None
        wal_retention_policy: main
        pre_backup_script: None
        post_backup_script: None
        minimum_redundancy: 0
        bandwidth_limit: None
        tablespace_bandwidth_limit: None
        current_xlog: 000000010000000A000000A3
        last_shipped_wal: 000000010000000A000000A2
        archive_command: rsync -a %p bar...@192.168.30.237:/sysmo/barman/test/%f
        server_txt_version: 9.2.3
        data_directory: /sysmo/sysmovs/dados/pgsql/data
        archive_mode: on
        config_file: /sysmo/sysmovs/dados/pgsql/data/postgresql.conf
        hba_file: /sysmo/sysmovs/dados/pgsql/data/pg_hba.conf
        ident_file: /sysmo/sysmovs/dados/pgsql/data/pg_ident.conf

barman@srv-backup:/sysmo/barman> barman status main
Server main:
        description: Servidor Principal
        PostgreSQL version: 9.2.3
        PostgreSQL Data directory: /sysmo/sysmovs/dados/pgsql/data
        archive_command: rsync -a %p bar...@192.168.30.237:/sysmo/barman/test/%f
        archive_status: last shipped WAL segment 000000010000000A000000A2
        current_xlog: 000000010000000A000000A3
        Retention policies: not enforced
        No. of available backups: 3
        first available backup: 20130710T151536
        last available backup: 20130710T151737


When I run the backup have this information:
--------------------------------------------------------------------------------
barman@srv-backup:/sysmo/barman> barman backup main
Starting backup for server main in /sysmo/barman/main/base/20130710T154050
Backup start at xlog location: A/A4000020 (000000010000000A000000A4, 00000020)
Copying files.
Copy done.
Asking PostgreSQL server to finalize the backup.
Backup end at xlog location: A/A40000E0 (000000010000000A000000A4, 000000E0)
Backup completed

Here we can see that the file size is zero ...
--------------------------------------------------------------------------------
barman@srv-backup:/sysmo/barman> barman list-backup main
main 20130710T154050 - Wed Jul 10 15:40:57 2013 - Size: 0 B - WAL Size: 0 B
main 20130710T151737 - Wed Jul 10 15:19:08 2013 - Size: 0 B - WAL Size: 0 B
main 20130710T151644 - Wed Jul 10 15:16:51 2013 - Size: 0 B - WAL Size: 0 B
main 20130710T151536 - Wed Jul 10 15:15:43 2013 - Size: 0 B - WAL Size: 0 B

barman@srv-backup:/sysmo/barman> barman show-backup main 20130710T154050
Backup 20130710T154050:
  Server Name       : main
  Status            : DONE
  PostgreSQL Version: 90203
  PGDATA directory  : /sysmo/sysmovs/dados/pgsql/data

  Base backup information:

When I try to restore, of course, I get an error.
--------------------------------------------------------------------------------
barman@srv-backup:/sysmo/barman> barman recover main 20130710T154050 /tmp/teste/
Starting local restore for server main using backup 20130710T154050
Destination directory: /tmp/teste/
Copying the base backup.
rsync: change_dir "/sysmo/barman/main/base/20130710T154050/pgdata" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]
ERROR: Unhandled exception. See log file for more details.

--------------------------------------------------------------------------------

Any idea what is my problem?

Gabriele Bartolini

unread,
Jul 16, 2013, 3:39:30 AM7/16/13
to pgba...@googlegroups.com
Hi,

On Wed, 10 Jul 2013 12:10:20 -0700 (PDT), Eurides Baptistella
<eurides.b...@gmail.com> wrote:
> I have a problem! I am not knowing how to use the Barman
> Performed the installation and configuration on a OpenSuse 12.2 with
> PostgreSQL 9.2 and 1.2.2 Barman.

We are aware there are issues with the OpenSuse Linux, probably due to
rsync issues. However, we have not yet been able to test and fix them as
currently we have never had the chance to install a Barman solution on
OpenSuse.

At the moment we do not have free time to work on this, but if someone
would like to sponsor OpenSuse compliance with Barman or suggest a
patch, please step up. ;)

Cheers,
Gabriele
--
Gabriele Bartolini - 2ndQuadrant Italia
PostgreSQL Training, Services and Support
Gabriele....@2ndQuadrant.it - www.2ndQuadrant.it
Message has been deleted

Eurides Baptistella

unread,
Jul 17, 2013, 10:48:07 AM7/17/13
to pgba...@googlegroups.com
Hi!


> I have a problem! I am not knowing how to use the Barman
> Performed the installation and configuration on a OpenSuse 12.2 with
> PostgreSQL 9.2 and 1.2.2 Barman.

 We are aware there are issues with the OpenSuse Linux, probably due to
 rsync issues. However, we have not yet been able to test and fix them as
 currently we have never had the chance to install a Barman solution on
 OpenSuse.

 At the moment we do not have free time to work on this, but if someone
 would like to sponsor OpenSuse compliance with Barman or suggest a
 patch, please step up. ;)

 Cheers,
 Gabriele

I'm investigated the problem and found a way out.
The problem is only with rsync, I could identify that OpenSuse does not work well when the command is passed as rsync -e 'ssh post...@192.168.30.37' and finally the directory of the data ":/usr/local/pgdata/data" for example.

So I made some changes in the source and posted on https://sourceforge.net/u/euridesb/pgbarman/

The problem is in line 860 of file backup.py
https://sourceforge.net/u/euridesb/pgbarman/ci/master/tree/barman/backup.py#l859

I also changed the line 864 to pass the correct path (post...@192.168.30.37:/usr/local/pgdata/data/)
https://sourceforge.net/u/euridesb/pgbarman/ci/master/tree/barman/backup.py#l863

With these changes also changed the source command_wrappers.py

I am not knowledgeable in Python, so my solution may not be ideal, but it worked :-)

I COULD NOT TEST THE COMPATIBILITY OF COMMAND RSYNC FOR OTHER DISTRIBUTIONS LINUX.

Ps.: At the moment unfortunately I can not contribute financially to the project, but thank you for the beautiful work they do. Thank you!
Reply all
Reply to author
Forward
0 new messages