I'm not that great with postgres but i was able to setup replication following this tutorial:
https://www.howtoforge.com/tutorial/how-to-set-up-master-slave-replication-for-postgresql-96-on-ubuntu-1604/
It all works great but the amount of WAL files is getting ridiculous.
I assume the slave should tell them master to remove old files, but I'm not sure how to do that.
I have the same settings as in the tutorial. I've already tried to "manually" clean them, which lead to a ton of problems. But right now the i'm using 30GB of space for the files and i'm afraid to do any more massive imports into my db because i will run out of space
Postgresql – Postgres replication not cleaning up WAL files
postgresqlreplicationwrite-ahead-logging
Related Question
- PostgreSQL – Understanding WAL Files and Size Generation
- PostgreSQL WAL Segment – Resolving WAL Segment Still Exists on Master Issue
- PostgreSQL – pg_xlog Not Recycling WAL Files on Slave Server
- PostgreSQL Streaming Replication – Too Many WAL Files in Archive Folder
- Postgresql – WAL archiving w/ streaming replication
- PostgreSQL – Fixing WAL Files Not Being Deleted and pg_drop_replication_slot Error
Best Answer
I think you're looking for the
archive_cleanup_command
setting in yourrecovery.conf
file:See the docs or this post for more info.