For this procedure, we will need two servers. The backup server will be named pg-backup, and our primary PostgreSQL server will be named pg-primary. Make sure to have the password for the barman system user and the postgres database user. As usual, our database is located at /db/pgdata.
Follow these steps:
- For Red Hat-based servers, use the following command:
- Install the Barman toolkit as a root-capable user:
sudo yum install barman
- Debian-based systems should use this command instead:
sudo apt-get install barman
- On the pg-backup server as the barman user, execute the following commands for direct SSH access to pg-primary as the postgres user:
ssh-keygen -t rsa -N '' ssh-copy-id postgres@pg-primary
- Execute this SQL ...