From: | Tomas Vondra <tv(at)fuzzy(dot)cz> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: streaming replication does not work across datacenter with 20ms latency? |
Date: | 2011-07-24 20:28:23 |
Message-ID: | 4E2C8067.2010803@fuzzy.cz |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
Dne 24.7.2011 14:46, Yan Chunlu napsal(a):
> checkpoint_segments = 64
> wal_keep_segments = 128
This information alone is not sufficient - we don't know how much write
activity is on the primary system, so we can't say if those number are
sufficient or not. You have to tune them according to write activity on
the primary server.
For example let's suppose the current WAL segment on the primary is "1"
and that it's configured with wal_keep_segments = 5 (i.e. about 80MB of
data).
Before you prepare and start the slave machine, someone writes 100MB of
data to the primary database (one big insert/update or a lot of small
ones, doesn't matter). 100MB is about 6 WAL segments, so the current WAL
segment on the primary is 7, and because of wal_keep_segments there are
segments 3,4,5,6,7 available.
But when the slave connects, it asks for segment no. 2 and it's not
available. It's not possible to skip that segment so the replication
fails to start.
If the primary only received 60MB of data, it'd probably worked (there'd
be enough segments kept on the primary).
Those 128 segments is about 2GB of data. How much data is written on the
primary between creating a filesystem copy and starting the slave?
You don't neet to keep the files on the master, you can set up archiving
and keep them somewhere else (on a different system etc.).
Tomas
From | Date | Subject | |
---|---|---|---|
Next Message | Mario Puntin | 2011-07-24 21:36:12 | Disallow access from psql, or allow access only from specific client app |
Previous Message | Chris Travers | 2011-07-24 18:54:27 | Re: weird table sizes |