Environment
PostgreSQL
Error Message
Error backing up database '5432', error code: ", [#300091]find archive path by cluster error
Cause
The backup fails because the related archive command path is not configured
Resolution
Database administrators are advised to perform the following operations.
Using PostgreSQL users create an archive folder.
For example: mkdir /var/lib/pgsql/14/archivedir
In your PostgreSQL server, please redirect to PostgreSQL Configuration file directory. (On CentOS, path is usually /var/lib/pgsql/version/data). Modify the postgresql.conf file, change the parameter.
archive_mode = on #enables archiveing, parameter must be on or always
wal_level = replica #Type of the log, parameter must be replica, logical
archive_command = 'test ! -f /var/lib/pgsql/14/archivedir/%f && cp %p /var/lib/pgsql/14/archivedir/%f'
#archive_mode file path should be the archive file you created before.
After you changed it, please restart the PostgreSQL service, the x.x should be the PostgreSQL's version.
systemctl restart postgresql-x.x.service