]> andersk Git - moira.git/blame - afssync/INSTRUCTIONS
Much revision from previous instructions, most of it apparently not
[moira.git] / afssync / INSTRUCTIONS
CommitLineData
26efe406 1[This is a still-under-construction rewrite of the afssync
2instructions, adapted to the Ingres/Maxine -> Oracle/SPARC port, and
3is also being updated and simplified.]
4
5
6The executables are in /moira/bin/ on the moira server, with sources
7in /mit/moiradev/src/afssync/. Most of the commands are run on the
8Moira server.
9
10FULL INSTRUCTIONS
11("SUMMARY" is below)
12
13#### This is preparation for the resync, to save non-Moira users. ####
14First, 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
19If 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
25to extract and prepare the personal groups and special user entries in
26the 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
30Get a list of all the @andrew.cmu.edu type (non- athena.mit.edu cell)
31users, and sync the Moira list afs-foreign-users to this list.
32Moira then adds those entries to the group system:afs-foreign-users,
33thus 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
38Do the equivalent of afs-foreign-users for domestic users. We make
39the afs-foreign-users list a member of the more general afs-odd-entities.
40WAIT 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
45to disable AFS incremental updates during the synchronization. The
46afs.incr (?) will wait 30 minutes on an incremental update before
47timing out, so the resync should complete in that time, or list
48changes in Moira might need to be propagated by hand.
49
50 /moira/bin/afssync /var/prdb.moira
51to dump the prdb data that is in Moira (users, groups, and group
52memberships). This step takes about ten minutes, but can be done
53concurrently with the next few steps.
54
55REPEAT the first two sets of commands, above, thus regenerating
56prdb.extra from a now completely-up-to-date prdb.
3d8d4b36 57
58*** Make sure the "afssync" command has completed ***
3d8d4b36 59
26efe406 60 cp /var/prdb.moira /var/prdb.new
61 /moira/bin/pt_util -w -d /var/prdb.extra.sort -p /var/prdb.new
62This use of pt_util will presumably log errors about failed user
63creations 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"
65type of lines that were caused by a user deactivation with something
66like:
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; }'
72Now, 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
84to watch the status of the servers to make sure things are going well,
85where "prill" is preferred db server (the sync site).
86
87Make sure the beacons are working, and that once quorom is established
88(~90 seconds) that the servers are resynchronizing their notions of
89the databases and that the "dbcurrent" and "up" fields all become set
90and the state goes to "1f". Also, if "sdi" isn't running, watch out
91for large rx packet queues on port 7002 using rxdebug, as the
92fileservers may get excessively backlogged, and restart servers, if
93necessary, if the congestion remains excessive.
94
95 pts listmax
96 cat /var/prdb.listmax
97and if the id maxima are lower than the saved ones, reset them
98appropriately to the saved ones using `pts setmax`.
99
100 pts ex system:administrators
101as a good spot check, especially since it has special people.
3d8d4b36 102(also spot check one of the personal groups and perhaps, something like
103the membership of rcmd.ronald-ann)
104
26efe406 105 rm /moira/afs/noafs
106to remove the lock file and let Moira's afs incrementals continue.
3d8d4b36 107
3d8d4b36 108
26efe406 109NOTES
3d8d4b36 110
26efe406 1111. Don't do this when you're tired... There may be no cleanup procedure
3d8d4b36 112available, with certain mistakes.
113
26efe406 1142. /moira/afs/noafs is only good for 30 minutes. Keep track of the
3d8d4b36 115critical log, and you may have to do some operations by hand when the
116operation is complete. Also, if requests depend on other requests, they
117may be processed out of order, and fail, and may need to be done by hand.
118
3d8d4b36 119
26efe406 120SUMMARY
121
122 # db servers with sync site first:
123set db=(prill agamemnon chimera orf)
124set u="/moira/bin/udebug -port 7002 -server"
125set prefix="/moira/sync/prdb"
126cd `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
133awk '/^[^ ][^:]*@/ {printf "KERBEROS:%s\n",$1}' $prefix.extra > extra.foreign
134blanche afs-foreign-users -f extra.foreign
135awk '/^[^ ][^:@]*$/ {printf "KERBEROS:%s\n",$1}' $prefix.extra > extra.domestic
136echo "LIST:afs-foreign-users" >> extra.domestic
137blanche afs-odd-entities -f extra.domestic
138
139#### WAIT for the above afs.incr events to take place (see moira.log)
140touch /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
145perl /moira/bin/pt_util.pl < $prefix.extra > $prefix.extra.sort
146wait
147more $prefix.afssync.err
148cp $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
152pts listmax > $prefix.listmax
153set dbdir=/usr/afs/db
154foreach i ( $db )
155 echo "$i..."
156 rcp -px $prefix.new ${i}:$dbdir
157end
158foreach i ( $db )
159 bos shutdown $i ptserver
160 bos exec $i "rm $dbdir/prdb.DB*; mv $dbdir/prdb.new $dbdir/prdb.DB0"
161end
162foreach i ( $db )
163 bos restart $i ptserver
164end
3d8d4b36 165
26efe406 166 # checks, etc:
167$u $db[1]
3d8d4b36 168
26efe406 169######## more on checks
3d8d4b36 170
26efe406 171rm /moira/afs/noafs
This page took 0.135408 seconds and 5 git commands to generate.