]> andersk Git - moira.git/blob - afssync/INSTRUCTIONS
Switch from Imake-based build system to autoconf-based.
[moira.git] / afssync / INSTRUCTIONS
1 [This is a still-under-construction rewrite of the afssync
2 instructions, adapted to the Ingres/Maxine -> Oracle/SPARC port, and
3 is also being updated and simplified.]
4
5
6 The executables are in /moira/bin/ on the moira server, with sources
7 in /mit/moiradev/src/afssync/.  Most of the commands are run on the
8 Moira server.
9
10 FULL INSTRUCTIONS
11 ("SUMMARY" is below)
12
13 ####    This is preparation for the resync, to save non-Moira users.    ####
14 First, get a recent copy of the prdb, and extract non-Moira entries:
15
16         /moira/bin/udebug orf -port 7002
17         rcp root@orf:/usr/afs/db/prdb.DB0 /var/prdb.old
18         /moira/bin/udebug orf -port 7002
19 If the two udebugs show that the version changed, lather-rinse-repeat.
20 (udebug can be found in afsuser; "orf" here and below is some DB server)
21 (Also check for "0 of them for write" at the end.  It might matter.)
22
23         /moira/bin/pt_util -x -m -u -g -d /var/prdb.extra -p /var/prdb.old
24         perl /moira/bin/pt_util.pl < /var/prdb.extra > /var/prdb.extra.sort
25 to extract and prepare the personal groups and special user entries in
26 the old prdb for being reincorporated into the new prdb.
27
28         awk '/^[^ ][^:]*@/ {printf "KERBEROS:%s\n",$1}' prdb.extra > foreign
29         blanche afs-foreign-users -f foreign
30 Get a list of all the @andrew.cmu.edu type (non- athena.mit.edu cell)
31 users, and sync the Moira list afs-foreign-users to this list.
32 Moira then adds those entries to the group system:afs-foreign-users,
33 thus keeping them from being lost in the prdb resync.
34
35         awk '/^[^ ][^:@]*$/ {printf "KERBEROS:%s\n",$1}' prdb.extra > oddities
36         echo "LIST:afs-foreign-users" >> oddities
37         blanche afs-odd-entities -f oddities
38 Do the equivalent of afs-foreign-users for domestic users.  We make
39 the afs-foreign-users list a member of the more general afs-odd-entities.
40 WAIT for the incremental updates from the `blanche` changes to complete.
41
42 ####   Now the actual resync begins.  Incremental updates must stop.   ####
43
44         touch /moira/afs/noafs
45 to disable AFS incremental updates during the synchronization.  The
46 afs.incr (?) will wait 30 minutes on an incremental update before
47 timing out, so the resync should complete in that time, or list
48 changes in Moira might need to be propagated by hand.
49
50         /moira/bin/afssync /var/prdb.moira
51 to dump the prdb data that is in Moira (users, groups, and group
52 memberships).  This step takes about ten minutes, but can be done
53 concurrently with the next few steps.
54
55 REPEAT the first two sets of commands, above, thus regenerating
56 prdb.extra from a now completely-up-to-date prdb.
57
58 *** Make sure the "afssync" command has completed ***
59
60         cp /var/prdb.moira /var/prdb.new
61         /moira/bin/pt_util -w -d /var/prdb.extra.sort -p /var/prdb.new
62 This use of pt_util will presumably log errors about failed user
63 creations and list additions.  (To start over, do both the `cp` and
64 `pt_util` again.)  You can filter out the "User or group doesn't exist"
65 type of lines that were caused by a user deactivation with something
66 like:
67         awk -F\| '$8 == 3 {print $1}' /backup/backup_1/users > /tmp/deactivated
68         perl -e 'for(cat /tmp/deactivated`){ chop; $ex{$_}=1;} \
69                 foreach $L (`cat prdb.extra.err`){ $f=0; \
70                 @w=split(/[ :]/,$L); for(@w){ $f=1 if $ex{$_}; } \
71                 next if $f; print $L; }'
72 Now, back to the resync.
73
74         pts listmax > /var/prdb.listmax
75         foreach i ( <db servers> )
76             bos shutdown $i ptserver
77             bos exec $i "rm /usr/afs/db/prdb.DB*; mv /usr/afs/db/prdb.new /usr/afs/db/prdb.DB0"
78         end
79         foreach i ( <db servers> )
80             bos restart $i ptserver
81         end
82
83         /moira/bin/udebug prill -port 7002
84 to watch the status of the servers to make sure things are going well,
85 where "prill" is preferred db server (the sync site).
86
87 Make sure the beacons are working, and that once quorom is established
88 (~90 seconds) that the servers are resynchronizing their notions of
89 the databases and that the "dbcurrent" and "up" fields all become set
90 and the state goes to "1f".  Also, if "sdi" isn't running, watch out
91 for large rx packet queues on port 7002 using rxdebug, as the
92 fileservers may get excessively backlogged, and restart servers, if
93 necessary, if the congestion remains excessive.
94
95         pts listmax
96         cat /var/prdb.listmax
97 and if the id maxima are lower than the saved ones, reset them
98 appropriately to the saved ones using `pts setmax`.
99
100         pts ex system:administrators
101 as a good spot check, especially since it has special people.
102 (also spot check one of the personal groups and perhaps, something like
103 the membership of rcmd.ronald-ann)
104
105         rm /moira/afs/noafs
106 to remove the lock file and let Moira's afs incrementals continue.
107
108
109 NOTES
110
111 1. Don't do this when you're tired...  There may be no cleanup procedure
112 available, with certain mistakes.
113
114 2. /moira/afs/noafs is only good for 30 minutes.  Keep track of the
115 critical log, and you may have to do some operations by hand when the
116 operation is complete.  Also, if requests depend on other requests, they
117 may be processed out of order, and fail, and may need to be done by hand.
118
119
120 SUMMARY
121
122         # db servers with sync site first:
123 set db=(prill agamemnon chimera orf)
124 set u="/moira/bin/udebug -port 7002 -server"
125 set prefix="/moira/sync/prdb"
126 cd `dirname $prefix`
127
128 #######    The following DOES NOT WORK currently.  pt_util needs fixing
129 ####    BEFORE Moira and afs.incr are closed off:
130         # repeat as necessary:
131 $u $db[2]; rcp root@$db[2]\:/usr/afs/db/prdb.DB0 $prefix.old; $u $db[2]
132 /moira/bin/pt_util -x -m -u -g -d $prefix.extra -p $prefix.old
133 awk '/^[^ ][^:]*@/ {printf "KERBEROS:%s\n",$1}' $prefix.extra > extra.foreign
134 blanche afs-foreign-users -f extra.foreign
135 awk '/^[^ ][^:@]*$/ {printf "KERBEROS:%s\n",$1}' $prefix.extra > extra.domestic
136 echo "LIST:afs-foreign-users" >> extra.domestic
137 blanche afs-odd-entities -f extra.domestic
138
139 ####    WAIT for the above afs.incr events to take place (see moira.log)
140 touch /moira/afs/noafs
141 /moira/bin/afssync $prefix.moira >& $prefix.afssync.err &
142         # repeat as necessary:
143 $u $db[2]; rcp root@$db[2]\:/usr/afs/db/prdb.DB0 $prefix.old; $u $db[2]
144 /moira/bin/pt_util -x -m -u -g -d $prefix.extra -p $prefix.old
145 perl /moira/bin/pt_util.pl < $prefix.extra > $prefix.extra.sort
146 wait
147 more $prefix.afssync.err
148 cp $prefix.moira $prefix.new
149 /moira/bin/pt_util -w -d $prefix.extra.sort -p $prefix.new >& $prefix.extra.err
150         # and review $prefix.extra.err
151
152 pts listmax > $prefix.listmax
153 set dbdir=/usr/afs/db
154 foreach i ( $db )
155     echo "$i..."
156     rcp -px $prefix.new ${i}:$dbdir
157 end
158 foreach i ( $db )
159     bos shutdown $i ptserver
160     bos exec $i "rm $dbdir/prdb.DB*; mv $dbdir/prdb.new $dbdir/prdb.DB0"
161 end
162 foreach i ( $db )
163     bos restart $i ptserver
164 end
165
166         # checks, etc:
167 $u $db[1]
168
169 ######## more on checks
170
171 rm /moira/afs/noafs
This page took 0.038936 seconds and 5 git commands to generate.