![]() ![]() |
![]() |
File: [Development] / JSOC / doc / dsc0_just_rebooted.txt
(download)
Revision: 1.2, Mon Sep 9 18:11:34 2013 UTC (10 years ago) by production Branch: MAIN CVS Tags: Ver_LATEST, Ver_DRMSLATEST, Ver_9-5, Ver_9-41, Ver_9-4, Ver_9-3, Ver_9-2, Ver_9-1, Ver_9-0, Ver_8-8, Ver_8-7, Ver_8-6, Ver_8-5, Ver_8-4, Ver_8-3, Ver_8-2, Ver_8-12, Ver_8-11, Ver_8-10, Ver_8-1, NetDRMS_Ver_LATEST, NetDRMS_Ver_9-5, NetDRMS_Ver_9-41, NetDRMS_Ver_9-4, NetDRMS_Ver_9-3, NetDRMS_Ver_9-2, NetDRMS_Ver_9-1, NetDRMS_Ver_9-0, NetDRMS_Ver_8-8, NetDRMS_Ver_8-7, NetDRMS_Ver_8-6, NetDRMS_Ver_8-5, NetDRMS_Ver_8-4, NetDRMS_Ver_8-3, NetDRMS_Ver_8-2, NetDRMS_Ver_8-12, NetDRMS_Ver_8-11, NetDRMS_Ver_8-10, NetDRMS_Ver_8-1, HEAD Changes since 1.1: +2 -0 lines *** empty log message *** |
dsc0_just_rebooted.txt Login to dcs0 and dcs2 as needed as postgres/production. NOTE: to use like jim after su - postgres (newuser1): > csh > source .jimalias NOTE!! For dcs1: Substitute dcs1 for dcs0 below and 5431 for 5430 Stop dcs0 DB on dcs0: pg_ctl -D /var/lib/pgsql/dcs0_data -m fast stop Stop dcs0/dcs1 warm standby on dcs2: pg_ctl -D /var/lib/pgsql/dcs0_data/ stop -m fast Make sure no /tmp/pgsql.trigger.5430 on dcs2 Login to dcs0 as postgres > ls -1 / | grep WALarchive | wc -l 1 NOTE: the original dcs0 will return 1. Orig dcs2 converted to dcs0 returns 0. If (0) then cp configfiles/postgresql.conf.dcs0.0 dcs0_data/postgresql.conf rm -f /data/WALarchive/5430/* if (1) then cp configfiles/postgresql.conf.dcs0.1 dcs0_data/postgresql.conf rm -f /WALarchive/5430/* Restart the dcs0 database to create WAL archives: > pg_ctl -D /var/lib/pgsql/dcs0_data/ start Begin the backup process on dcs0: > psql -p 5430 -c "select pg_start_backup('2010-03-15')" Create a tar archive of the system data directory: > tar -czvf dcs0_backup.tar.gz dcs0_data/ Stop the backup process on dcs0: > psql -p 5430 -c "select pg_stop_backup()" Copy the archive file from dcs0 to dcs2: > scp dcs0_backup.tar.gz postgres@dcs2:/var/lib/pgsql/ Now login to dcs2 as postgres: > rm -rf dcs0_data Uncompress the archive file: > tar -xzvf dcs0_backup.tar.gz > ls -1 / | grep WALarchive | wc -l 0 if(0) then cp configfiles/recovery.conf.dcs0.0 dcs0_data/recovery.conf cp configfiles/postgresql.conf.dcs0.ws dcs0_data/postgresql.conf if(1) then cp configfiles/recovery.conf.dcs0.1 dcs0_data/recovery.conf cp configfiles/postgresql.conf.dcs0.ws dcs0_data/postgresql.conf Remove the postmaster.pid file: > rm dcs0_data/postmaster.pid > chmod 700 /var/lib/pgsql/dcs0_data/ Start the dcs0 warm standby server, execute the command: > pg_ctl -D /var/lib/pgsql/dcs0_data/ start The server should go into recovery mode and stay there. This msg is ok: LOG: could not create IPv6 socket: Address family not supported by protocol ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Now as user production on dcs0: See the file /home/production/cvs/JSOC/doc/whattodo_dcs.txt
Karen Tian |
Powered by ViewCVS 0.9.4 |