I have master slave replication setup. How I can force some delay in replication ?
Is there a setting that I can use ?
Thanks !
Not in 9.3.
In 9.4 you can use min_recovery_apply_delay. See this blog post.
In 9.3, if you have WAL-archive based replication (no streaming) you could archive the WAL to one location, and only move it to a location readable by the standby after a delay. You can't do it with streaming in 9.3.
Related
Is postgresql physical replication from v9.6 to v15 possible ? Thanks.
Not tested , I think it will not work.
Yes, you are right, that will not work. Streaming replication requires both servers to have the same major version.
In postgres streaming replication master-slave setup, can we create views only on slave/standby server?
Can I have more than one standby slaves?
I am using postgresql 9.3.
re 1): this is not possible. The slave is always a 100% identical copy of the master.
re 2): yes this is possible. Quote from the manual:
You can have any number of standby servers
all instructions lead to synchronize data folders from master server to slave. But it can not be done between major releases.
ps: general task is update master and slave server from 9.1 to 9.3
It is not entirely clear what you are talking about.
If you're talking about slony replication, it is designed to replicate data across versions. I've replicated databases from 8.4 to 9.1. You must have running the same schema (regarding the replicated objects) on both servers already. Slony replicates tables and sequences very well, it has some stuff for replicating schema changes, but I prefer doing this out-of-band.
If you're talking about in-place upgrading your db server, I'd suggest reading the fine documentation and going from 9.1 to 9.2, then to 9.3 (just to be cautious)
Is there any tools for replication in postgres which can doing the following :
automatic DDL replication?
when master DB down, then slave will become the master DB immediately.
my company database is +- 5GB size
i have search some tools for replication which is slony and bucardo (and all trigger based replication system cannot doing the DDL replication)(source). and for 9.0 Streaming Replication (built in on postgres),Gabriel Weinberg (DuckDuckGo)said "Steve Signer wrote up some cases where you wouldn't want to/be able to use the built-in replication"
so 3 tools i found (slony,bucardo and 9.0 SR) , doesnt meet my criteria to do the postgres. is there any suggestion?
thanks
automatic DDL replication?
=> Use streaming replication, replicates everything.
when master DB down, then slave will become the master DB immediately.
=> pgPool does it's job over here, works fine.
my company database is +- 5GB size
=> That's very small, don't worry.
You can use debezium for replication transactions (insert, delete and update)... for ddl you can use kafka connect ;)
Is it possible to exclude a specific database from streaming replication in Pg 9.1?
Say I have two databases A and B defined, the goal is to ignore everything concerning database B on the backup server.
Thanks for your hints!
No, it's not possible. The replication always works for the complete cluster.
With Postgres 9.5 or later you can use the extension pglogical to do that.
Use Slony-I http://slony.info/ or other replication solutions to replicate partially.