checkpoint_segments = 64 wal_keep_segments = 128 this setting seems is for 5GB capacity, I think there is noway I would ever write 5GB data during the rsync progress. I think the problem is still "invalid record length" and "invalid magic number", it start showing right after I complete sync data and start slave. If I stop slave later and restart, yes it could show xlog not found and can not catch master. but why the "invalid" things in the first place? On Mon, Jul 25, 2011 at 4:28 AM, Tomas Vondra <tv@xxxxxxxx> wrote: > 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 > > > -- > Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-general > -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general