archive command for streaming from/to localhost

104 views
Skip to first unread message

dulh...@mailbox.org

unread,
Mar 1, 2022, 12:55:51 PM3/1/22
to pgba...@googlegroups.com
I run a local instance where barman and postgres run on the same machine

There is trouble with backups and read an error in the postgres logs complaining about the archive_command
archive_command = 'barman-wal-archive localhost:/var/lib/barman/postgres-local/incoming localhost %p'
I am wondering whether my problem lies in
  1. localhost not being interpreted right
  2. the separator : in localhost:/path/to/dir, or
  3. the sequence barman-server postgres-server being the wrong way around

Luca Ferrari

unread,
Mar 2, 2022, 4:18:56 AM3/2/22
to Barman, Backup and Recovery Manager for PostgreSQL
On Tue, Mar 1, 2022 at 6:55 PM dulhaver via Barman, Backup and
Recovery Manager for PostgreSQL <pgba...@googlegroups.com> wrote:
>
> I run a local instance where barman and postgres run on the same machine
>
> There is trouble with backups and read an error in the postgres logs complaining about the archive_command
>
> archive_command = 'barman-wal-archive localhost:/var/lib/barman/postgres-local/incoming localhost %p'

you are using barman-wal-archive as it was a kind of rsync, but the
command is simpler:

barman-wal-archive -U postgres localhost localhost %p

or something like that. You need to specify the user, the target host,
the name of the host in the configuration and %p placeholder.
Now, running this on localhost means you are going to load the
internal netwrork instead of a direct file trnsfer.

Luca

dulh...@mailbox.org

unread,
Mar 2, 2022, 10:51:54 AM3/2/22
to pgba...@googlegroups.com
hi Luca,

thx for your suggestion
I run a local instance where barman and postgres run on the same machine
There is trouble with backups and read an error in the postgres logs complaining about the archive_command
archive_command = 'barman-wal-archive localhost:/var/lib/barman/postgres-local/incoming localhost %p'

you are using barman-wal-archive as it was a kind of rsync, but the command is simpler:

barman-wal-archive -U postgres localhost localhost %p

or something like that. You need to specify the user, the target host, the name of the host in the configuration and %p placeholder.
Now, running this on localhost means you are going to load the internal network instead of a direct file transfer.
still not luck here though. postgres logs still dislike the archive command, backup still freezes up

    The failed archive command was: barman-wal-archive -U postgres localhost postgres-local pg_wal/000000010000000000000001

the same error happens with any combination of these values (postgres-local being the name of the postgres host in the configuration)

Luca Ferrari

unread,
Mar 3, 2022, 3:02:20 AM3/3/22
to Barman, Backup and Recovery Manager for PostgreSQL
On Wed, Mar 2, 2022 at 4:51 PM dulhaver via Barman, Backup and
Recovery Manager for PostgreSQL <pgba...@googlegroups.com> wrote:
> The failed archive command was: barman-wal-archive -U postgres localhost postgres-local pg_wal/000000010000000000000001
>

You should open a shell, become "postgres" and run the command
PostgreSQL complains about. Probably there is an ssh key problem or
some mispelled argument.
Once you have figured out, you can fix the archive_command.

Luca

dulh...@mailbox.org

unread,
Mar 3, 2022, 2:15:07 PM3/3/22
to pgba...@googlegroups.com
this was quite painful, but after a couple of hours I figured something out. Thanks Luca for the pointers
archive_command = 'barman-wal-archive localhost postgres-local /var/lib/pgsql/14/data/%p'
Probably there is an ssh key problem or some mispelled argument.

I guess this comment in the manual on SSH connections had quite some part is this

    "NOTE: This procedure is not needed if you plan to use the streaming connection only to archive transaction logs and backup your PostgreSQL server."
Reply all
Reply to author
Forward
0 new messages