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
If the only reason you are using a WAL archive is to do log shipping for the replication (as opposed to other reasons, like wanting to maintain the ability to do PITR), then you should stop using a WAL archive and switch to solely using streaming replication instead. To insure enough WAL is kept to support the replica you can use replication slots rather than a WAL archive, that way the replica does report back on which files can be removed and master removes, just like you want.