Assuming we have a server that should be archiving transaction logs, follow these steps to store them in a cloud service using WAL-E:
- Edit the postgresql.conf file to reflect these parameter settings:
wal_level = 'replica' archive_mode = 'on' archive_command = 'envdir /etc/wal-e/env wal-e wal-push %p' archive_timeout = '60'
- Restart the PostgreSQL service with the following command as the postgres user:
pg_ctl -D /db/pgdata restart
- Connect as the postgres user and force it to switch transaction logs with this SQL:
SELECT pg_switch_xlog();
- Watch the end of the PostgreSQL log file for transmission success. Use a command similar to this to capture WAL-E specific information:
tail -f /var/log/postgresql/postgresql-9.6-main.log ...