Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000418.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: Backup Registry Server/Triggers</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000417.html" title="Clearcase Support/New Clearquest setup" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000420.html" title="Remedy/Irvine Access/P4 ticket" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000417.html">&laquo; Clearcase Support/New Clearquest setup</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000420.html">Remedy/Irvine Access/P4 ticket &raquo;</a>
44                      </p>
45
46                      <a id="a000418"></a>
47                      <div class="entry" id="entry-418">
48                         <h3 class="entry-header">Backup Registry Server/Triggers</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <ul>
52   <li>Investigated how to setup, configure and failover Clearcase backup registry</li>
53
54   <li>Working with Shivdutt to set up new Clearquest server software</li>
55
56   <li>Ported mktriggers.pl and RemoveEmptyBranch.pl. Added RM_EMPTY_BRANCH to vobs on ccase-rmna-1</li>
57 </ul>
58                            </div>
59                            <div id="more" class="entry-more">
60                               <h2>Clearcase Backup Registry</h2>
61
62 <p>I've looked into how to setup a Clearcase Backup Registry as well as how it is supposed to function when a failure occurs and a switchover is necessary.</p>
63
64 <h3>Introduction</h3>
65
66 <p>Clearcase provides a mechanism to set up a backup registry server in the event that the primary registry server fails. If done properly switching over to the backup registry server is quick and easy. It is not, however, without it's potential problems<sup>1</sup>.</p>
67
68 <h3>Setup</h3>
69
70 <p>To setup a Clearcase Backup Registry Server you must first define which servers will be the primary and secondary register servers<sup>2</sup>. Let's assume rgy1 is the primary and rgy2 is the backup. Next you configure rgy1 to tell it that the backup registry server is rgy2 by adding a line to /var/adm/rational/clearcase/rgy/rgy_hosts.conf.</p>
71
72 <h3>Normal Operation</h3>
73
74 <p>In normal operation Clearcase runs a scheduled job called Daily Registry Backup on all hosts. On all hosts except the designated backup registry server this job does little if anything.</p>
75
76 <blockquote>
77   <p><font class="dim">I have a note that when run on a Windows client it will ask what the backup registry server is and if found and if different, will store that value in the Windows registry, thus Windows clients are self configuring. This should be tested however.</font></p>
78 </blockquote>
79
80 <p>On the backup registry host the job will obtain a snapshot of the registry from the primary registry server. By default 3 days worth of copies are kept.
81
82 <h3>Switchover</h3>
83
84 <p>If the primary registry server fails all that needs to be done is to run rgy_switchover which will promote the backup registry server to be a primary registry server. It will also inform all clients of the change. When the primary comes back it is configured as a backup of the new primary and optionally rgy_switchover'd to be a primary again</p>
85
86 <h3>Notes</h3>
87   <ol>
88     <li>There is no guarantee that rgy_switchover will be able to successfully switch over all clients. Clients may not be available on the network, for example. It will report which clients were not switched over and they can be fixed manually.</li>
89
90     <li>What are our registry servers? The Clearcase Admin Console shows me the following:<br>
91     <blockquote>
92       <ol>
93         <li>ccase-atla-1</li>
94         <li>ccase-gera-1</li>
95         <li>ccase-irva-2</li>
96         <li>ccase-rmna-3</li>
97         <li>ccase-sdoa-1</li>
98         <li>ccase-sj1-1</li>
99         <li>ccase-sj1-3</li>
100         <li>ccase-sj1-4</li>
101         <li>ccase-sj1-5</li>
102         <li>ccase-sj1-7</li>
103         <li>ccase-sj1-8</li>
104         <li>ldt-sdoa-013</li>
105       </ol>
106    </blockquote>
107
108     <p>It seems as if multiple registry servers were used instead of using one global registry and dividing things up by Clearcase regions. In any event, which of these primary registry servers need to be backed up and to where?</p>
109
110     <p>Also, it is not a good practice to put your registry on the same box as your other Clearcase objects (i.e. views or vobs). Say, for example, ccase-rmna-3 blows a disk drive and will be down for quite some time. Sure ccase-rmna-2 might be it's backup registry server and we could switch over the clients, etc. However what good would that do if the vob data they wish to get to is on ccase-rmna-3! Answer: No good at all. That machine is down - period.</p>
111
112     <p>I would recommend that we have one global registry server and a backup server. The backup server can be a vob machine or some other machine which houses important Clearcase data. The theory here is that, as a backup server, it's service time is limited - IOW it's only going to be functioning as a primary registry server for the time that the primary is out. While slightly risky it's only used for a limited time and when there's an emergency.</p>
113   </ol>
114
115 <h3>Mktriggers.pl & RemoveEmptyBranch.pl</li>
116
117 <p>Shivdutt and I feel that the problem that check_full_baseline is hitting is initially caused by having elements that have a 0 element on a branch. This is a common problem as I've explained before - a user checks out a file, it is branched and a 0 element is created as well as a checked out element:</p>
118
119 <img src="/Images/CheckedOut.jpg">
120
121 <p>If the user then cancels the checkout then we are left with:</p>
122
123 <img src="/Images/AfterCancellingCheckout.jpg">
124
125 <p>There is no difference between /main/1 and /main/andys_branch/0. Both /main/andys_branch/0 and /main/andys_branch can be safely removed. I believe that check_full_baseline corrects this situation by creating yet another identical version /main/andys_branch/1 and checking in yet another identical version.</p>
126
127 <p>The RemoveEmptyBranch.pl trigger corrects this condition at uncheckout (rmver and rmbranch) time by detecting this situation and removing both /main/andys_branch/0 and /main/andys_branch. It will only do so if the 0 element is the only thing there. If there are labels attached to the 0 element it will not remove it.</p>
128
129 <p>In order to implement this trigger I had to get the code working here at Broadcom. The RemoveEmptyBranch.pl trigger runs right out of the box, however things must be placed the proper places here at Broadcom. Additionally this trigger should be added to all vobs. Suffice to say, as a Clearcase Admin, I've hit this problem before.</p>
130
131 <p>My solution is a mktriggers.pl script which adds (or replaces) triggers on all public vobs in a region based on data in a data file which describes triggers. Mktriggers.pl is smart to skips private vobs and UCM project vobs.</p>
132
133 <p>Finally, mktriggers.pl uses a module of mine called Display.pm, which provides a consistent way of displaying messages.</p>
134
135 <p>To this regard I have created/ported the following files in //fs-rmna-01/Projects-V0/cc4:</p>
136
137 <blockquote><p>
138   <b>bin/mktriggers.pl:</b> Script to make/replace triggers in all vobs based on triggers.dat<br>
139   <b>etc/triggers.dat:</b> Data file describing triggers (currently only describing RM_EMPTY_BRANCH)<br>
140   <b>triggers/RemoveEmptyBranch.pl:</b> The RM_EMPTY_BRANCH trigger<br>
141   <b>lib/Display.pm:</b> Perl module for displaying messages, errors, warnings consistently<br>
142   <b>lib/Logger.pm:</b> Perl Object for handling creating and manipulating log files (Not used yet)<br>
143 </p></blockquote>
144
145 <p>Here's a usage for mktriggers.pl:</p>
146 <div class="code"><pre>
147     $ mktriggers.pl -u
148     Usage mktriggers.pl: [-u] [-n] [-a] [-r] [-v] [ -vobs <vob tag list> ]
149     Where:
150             -u      Displays this usage
151             -n      No execute mode - just echo out what would have been done
152             -r      Perform only replacements of triggers
153             -a      Perform only adds of triggers that are missing
154             -v      Verbose
155             -d      Debug
156             -vobs   List of vob tags to apply triggers to (default all vobs)
157 </pre></div>
158
159 <p>As you can see there is a no execute mode which just shows what would have been done. Add -v for verbose and it will also echo out the commands that would have been performed. You can also limit mktriggers.pl to only doing additions (-a) or replacements (-r).</p>
160
161 <p>Mktrigger.pl's data files is in etc/triggers.dat. It's format is relatively simple:</p>
162 <div class="code"><pre>
163     # Triggers
164     #################################################################################
165     #
166     # File:         triggers.dat
167     # Description:  Describes the triggers to be implemented.
168     # Author:       Andrew@DeFaria.com
169     # Created:      Mon Mar 15 08:48:24 PST 2004
170     # Language:     None
171     #
172     # (c) Copyright 2004, Andrew@DeFaria.com, all rights reserved.
173     #
174     ################################################################################
175     #
176     # Only the following keywords are currently recognized:
177     #
178     #       Trigger:        Introduces the trigger and gives it its name
179     #       Description:    Used for the trigger type's comment
180     #       Type:           Type of trigger (so far they're all -element -all)
181     #       Opkinds:        Operation kinds that will cause the trigger to fire
182     #       ScriptEngine:   Currently only supporting ccperl (C:\Program
183     #                       Files\Rational\ClearCase\bin\ccperl)
184     #       Script:         Script to run (under triggers)
185     #       Vobs:           Can be either base, ucm, all or a list of vob tags.
186     #                       If base is specified then the trigger is applied to
187     #                       all base Clearcase vobs. If ucm is specified then the
188     #                       trigger is applied to all ucm vobs. If all is
189     #                       specified (or if Vobs is not present) then the trigger
190     #                       is applied to all vobs (base and ucm). Otherwise the
191     #                       value is considered a space separated list of vob tags
192     #                       (without the leading "\") and the trigger is applied
193     #                       only to those vobs.
194     #       EndTrigger      Ends this trigger definition.
195     #
196     ################################################################################
197     Trigger:        RM_EMPTY_BRANCH
198     Description:    Remove empty branches after uncheckout, rmver or rmbranch
199     Type:           -element -all
200     Opkinds:        -postop rmbranch,rmver,uncheckout
201     ScriptEngine:   Perl
202     Script:         RemoveEmptyBranch.pl
203     EndTrigger
204 </pre></div>
205
206 <p>Next I applied the triggers to ccase-rnma-1 since this is our replicated backup of production and here's the output:</p>
207
208 <div class="code"><pre>
209     bash-2.05b$ bin/mktriggers.pl -v
210     Adding trigger RM_EMPTY_BRANCH to vob /vobs/A1... done
211     Adding trigger RM_EMPTY_BRANCH to vob /vobs/CommEngine... done
212     Adding trigger RM_EMPTY_BRANCH to vob /vobs/NewTest... done
213     Adding trigger RM_EMPTY_BRANCH to vob /vobs/OnePhone... done
214     Adding trigger RM_EMPTY_BRANCH to vob /vobs/SpiceBoxSW... done
215     Adding trigger RM_EMPTY_BRANCH to vob /vobs/TrainCommEngine... done
216     Adding trigger RM_EMPTY_BRANCH to vob /vobs/alpha_video... done
217     Adding trigger RM_EMPTY_BRANCH to vob /vobs/bfc_systems... done
218     Adding trigger RM_EMPTY_BRANCH to vob /vobs/cablex... done
219     Adding trigger RM_EMPTY_BRANCH to vob /vobs/cablex_tools... done
220     Adding trigger RM_EMPTY_BRANCH to vob /vobs/docs... done
221     Adding trigger RM_EMPTY_BRANCH to vob /vobs/ldx_apps... done
222     Adding trigger RM_EMPTY_BRANCH to vob /vobs/ldx_dev... done
223     Adding trigger RM_EMPTY_BRANCH to vob /vobs/ldx_hausware... done
224     Adding trigger RM_EMPTY_BRANCH to vob /vobs/ldx_tools... done
225     Adding trigger RM_EMPTY_BRANCH to vob /vobs/lucentexcel... done
226     Adding trigger RM_EMPTY_BRANCH to vob /vobs/netro_apps... done
227     Adding trigger RM_EMPTY_BRANCH to vob /vobs/phonex... done
228     Adding trigger RM_EMPTY_BRANCH to vob /vobs/prot_callctrl... done
229     Adding trigger RM_EMPTY_BRANCH to vob /vobs/prot_h248... done
230     Adding trigger RM_EMPTY_BRANCH to vob /vobs/prot_mgcp... done
231     Adding trigger RM_EMPTY_BRANCH to vob /vobs/prot_openssl... done
232     Adding trigger RM_EMPTY_BRANCH to vob /vobs/prot_tools... done
233     Adding trigger RM_EMPTY_BRANCH to vob /vobs/rmna_projects... done
234     Adding trigger RM_EMPTY_BRANCH to vob /vobs/sec_uHSMnCipher... done
235     Adding trigger RM_EMPTY_BRANCH to vob /vobs/telecan... done
236     Adding trigger RM_EMPTY_BRANCH to vob /vobs/test_comp1... done
237     Adding trigger RM_EMPTY_BRANCH to vob /vobs/test_docs... done
238     Adding trigger RM_EMPTY_BRANCH to vob /vobs/test_pvob... done
239     Adding trigger RM_EMPTY_BRANCH to vob /vobs/test_trp_vob... done
240     Adding trigger RM_EMPTY_BRANCH to vob /vobs/voice_res_gw... done
241     Adding trigger RM_EMPTY_BRANCH to vob /vobs/widcomm_bluetooth... done
242     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_common... done
243     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_drivers... done
244     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_qa... done
245     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_qa_cbx... done
246     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_qa_ipp... done
247     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_qa_ldx... done
248     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_qa_op... done
249     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xchg_qa_xme... done
250     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xme... done
251     Adding trigger RM_EMPTY_BRANCH to vob /vobs/xme_sa... done
252     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_Nucleus... done
253     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_TCL... done
254     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_VxWorks... done
255     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_cygwin... done
256     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_eCos... done
257     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_gnu_mips_elf... done
258     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_misc... done
259     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_psos... done
260     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_ti54x... done
261     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_vc... done
262     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_x86... done
263     Adding trigger RM_EMPTY_BRANCH to vob /vobs/zOEMtools_zsp... done
264 </pre></div>
265
266 <p>When neither add (-a) or replace (-r) is specified mktriggers.pl both adds and/or replaces triggers. If run again with only -a (meaning only add missing triggers) no additional triggers are added. This is a good way to check that no new vobs have been created that are missing triggers or to only add triggers to a vob you just created. You could also specify something like mktriggers.pl -a -vobs /vobs/newvob. Combined with no execute mode and you can easily check if there are any missing triggers without adding them (i.e. mktriggers.pl -n -a).</p>
267                            </div>
268                         </div>
269                         <p class="entry-footer">
270                            <span class="post-footers">Posted by  on September 12, 2005 12:54 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000418.html">Permalink</a>
271                         </p>
272                      </div>
273
274                      
275
276                      
277                   </div>
278                </div>
279             </div>
280          </div>
281       </div>
282    </div>
283 </body>
284 </html>