ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/JSOC/doc/dsc0_just_rebooted.txt
Revision: 1.2
Committed: Mon Sep 9 19:11:34 2013 UTC (10 years ago) by production
Content type: text/plain
Branch: MAIN
CVS Tags: NetDRMS_Ver_8-8, Ver_8-5, NetDRMS_Ver_8-1, Ver_LATEST, NetDRMS_Ver_LATEST, NetDRMS_Ver_8-12, NetDRMS_Ver_8-10, NetDRMS_Ver_8-11, NetDRMS_Ver_9-1, NetDRMS_Ver_9-0, NetDRMS_Ver_9-3, NetDRMS_Ver_9-2, NetDRMS_Ver_9-5, NetDRMS_Ver_9-4, NetDRMS_Ver_8-2, NetDRMS_Ver_8-3, NetDRMS_Ver_9-41, Ver_9-41, Ver_DRMSLATEST, NetDRMS_Ver_8-4, NetDRMS_Ver_8-5, NetDRMS_Ver_8-6, Ver_8-8, NetDRMS_Ver_8-7, Ver_8-2, Ver_9-3, Ver_8-1, Ver_8-6, Ver_8-7, Ver_8-4, Ver_8-11, Ver_9-1, Ver_8-3, Ver_9-5, Ver_9-4, Ver_8-10, Ver_9-2, Ver_8-12, Ver_9-0, HEAD
Changes since 1.1: +2 -0 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 dsc0_just_rebooted.txt
2
3 Login to dcs0 and dcs2 as needed as postgres/production.
4
5 NOTE: to use like jim after su - postgres (newuser1):
6 > csh
7 > source .jimalias
8
9 NOTE!! For dcs1: Substitute dcs1 for dcs0 below and 5431 for 5430
10
11 Stop dcs0 DB on dcs0: pg_ctl -D /var/lib/pgsql/dcs0_data -m fast stop
12
13 Stop dcs0/dcs1 warm standby on dcs2:
14 pg_ctl -D /var/lib/pgsql/dcs0_data/ stop -m fast
15
16 Make sure no /tmp/pgsql.trigger.5430 on dcs2
17
18 Login to dcs0 as postgres
19 > ls -1 / | grep WALarchive | wc -l
20 1
21 NOTE: the original dcs0 will return 1. Orig dcs2 converted to dcs0 returns 0.
22
23 If (0) then
24 cp configfiles/postgresql.conf.dcs0.0 dcs0_data/postgresql.conf
25 rm -f /data/WALarchive/5430/*
26
27 if (1) then
28 cp configfiles/postgresql.conf.dcs0.1 dcs0_data/postgresql.conf
29 rm -f /WALarchive/5430/*
30
31 Restart the dcs0 database to create WAL archives:
32 > pg_ctl -D /var/lib/pgsql/dcs0_data/ start
33
34 Begin the backup process on dcs0:
35 > psql -p 5430 -c "select pg_start_backup('2010-03-15')"
36 Create a tar archive of the system data directory:
37 > tar -czvf dcs0_backup.tar.gz dcs0_data/
38 Stop the backup process on dcs0:
39 > psql -p 5430 -c "select pg_stop_backup()"
40 Copy the archive file from dcs0 to dcs2:
41 > scp dcs0_backup.tar.gz postgres@dcs2:/var/lib/pgsql/
42 Now login to dcs2 as postgres:
43 > rm -rf dcs0_data
44 Uncompress the archive file:
45 > tar -xzvf dcs0_backup.tar.gz
46 > ls -1 / | grep WALarchive | wc -l
47 0
48
49 if(0) then
50 cp configfiles/recovery.conf.dcs0.0 dcs0_data/recovery.conf
51 cp configfiles/postgresql.conf.dcs0.ws dcs0_data/postgresql.conf
52 if(1) then
53 cp configfiles/recovery.conf.dcs0.1 dcs0_data/recovery.conf
54 cp configfiles/postgresql.conf.dcs0.ws dcs0_data/postgresql.conf
55 Remove the postmaster.pid file:
56 > rm dcs0_data/postmaster.pid
57 > chmod 700 /var/lib/pgsql/dcs0_data/
58 Start the dcs0 warm standby server, execute the command:
59 > pg_ctl -D /var/lib/pgsql/dcs0_data/ start
60 The server should go into recovery mode and stay there.
61 This msg is ok:
62 LOG: could not create IPv6 socket: Address family not supported by protocol
63
64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
65 Now as user production on dcs0:
66
67 See the file /home/production/cvs/JSOC/doc/whattodo_dcs.txt
68