Postgres recovery.conf options I am setting up Postgres binary replication.

In my slave's recovery.conf, I am suggested to have 2 options.

I am wondering if the directory specified in restore_command and archive_cleanup_commands are referring to directory paths in the master OR the slave?

restore_command = 'cp -f /home/postgres/data/wals/%f %p &lt;/dev/null'
archive_cleanup_command = '/usr/pgsql-9.2/bin/pg_archivecleanup /home/postgres/data/wals/ %r'


For instance, in restore_command is /home/postgres/data/wals referring to the path in the master?
Likewise for archive_cleanup_command?

The reason I am asking is because the paths are not similar between the 2 servers.
I assume you realize that the two servers both need to have access to the WAL archive - so if you are using commands such as 'cp' then you would have to be using NFS or some other similar technology to achieve it.

The contents of recovery.conf on the slave refer to processes on the slave, so the path you should use is the path to the WAL archive dir as seen on the slave.

The path specified in archive_command in postgresql.conf on the master refers to the WAL archive dir as seen on the master.

I recommend if at all possible you align the machines so that the path is the same (which you can do via symlinks or by changing mount points). When you use pg_basebackup to create your slave, it copies across complete contents of the master including config files, so it makes life easier if the same paths are valid in both machines.