夜澜偶作庄周梦 酒后聊为楚客狂

实现已知的理论,这仅仅称为技术,探索未知的领域,才是科学的真谛

原创 Rational ClearCase Multiside 员工培训实验 UNIX/Linux Platform收藏

新一篇: AIX服务器信息收集说明 | 旧一篇: 华中电网项目日志:软件需求说明书编写规范

Exercise 1 Solution
starting
 
Steps
Comments
1.    Look at the file /var/adm/rational/clearcase/config/shipping.conf on lab host. Make sure there is a line specifying the administrator who will receive e-mail notification. Add your login-id if you are not listed as an Administrator.
(you must be root to modify this file)
2.    (Optional) Set up aliases for the following ClearCase and MultiSite commands in your shell startup scripts: (.cshrc/.profile).
 
 
ct
cleartool
cth
cleartool history
m
multitool
mke
multitool mkreplica -export
mki
multitool mkreplica -import
mse
multitool syncreplica -export
msi
multitool syncreplica -import
 

1.    As you proceed through the exercises, fill in the table below to keep track of your replicas and their corresponding VOB-tags and storage locations:
 
replica Name
VOB-tag Directory
VOB Storage Location
GROUP_usa
/tmp/GROUP_usa
~/GROUP_usa.vbs
GROUP_europe
/tmp/GROUP_europe
~/GROUP_europe.vbs
GROUP_asia
/tmp/GROUP_asia
~/GROUP_asia.vbs
 
2.    Make a VOB according to the following specifications:
  • VOB-tag: /tmp/GROUP_usa
·         VOB storage: <WORK>/GROUP_usa.vbs
cleartool mkvob -tag /tmp/GROUP_usa ~/GROUP_usa.vbs
3.    Create the mount point (==VOB-tag) for this original replica.
mkdir /tmp/GROUP_usa
4.    Mount the GROUP_usa replica and cd to the VOB mount point.
cleartool mount /tmp/GROUP_usa
cd /tmp/GROUP_usa
5.    Use lsreplica to list the current replicas.
ls
6.    Make a replica of GROUP_usa using the following specifications:
  • Working directory: /tmp/GROUP_work_dir
  • Replica hostname: LAB host
  • Replica name: GROUP_Europe
  • Use –fship to send the packet immediately
multitool mkreplica -export -workdir /tmp/GROUP_work_dir -fship
   host2:GROUP_europe
7.    Make a view according to the following specifications:
  • View-tag: GROUP_usa_view
·         View storage: <WORK>/GROUP_usa_view.vws
cleartool mkview -tag GROUP_usa_view ~/GROUP_usa_view.vws
8.    Set to the new view.
cleartool setview GROUP_usa_view
9.    Do a directory listing to ensure that you are in the VOB. (You should see only a lost+found directory.)
ls
10.Check out the current directory.
cleartool co -nc .
11.Make an element called hello.c and check out the first version of the file. Create some content for the file (type in a few lines).
cleartool mkelem -c "element of type file " hello.c
vi hello.c
12.When you are done, check in hello.c.
cleartool ci -c "initial version of element" hello.c
13.Check in the directory.
cleartool ci -nc .
14.Use lsreplica to see the current replicas.
multitool lsreplica
15.Rename the original replica to: GROUP_usa.
multitool rename replica:original GROUP_usa
16.List the replicas that your current VOB knows about.
multitool lsreplica
17.Open a second shell. Move the window to an area on your desktop so that both displays are easily accessible.
18.In the second shell, use lspacket to list any incoming packets in the storage bays. 
rlogin host2 -l login_id (same login_id you used on host1)
multitool lspacket
19.Import the replication packet you created in Step 6, using mkreplica -import according to the following specifications:
  • Working directory: /tmp/GROUP_work_dir
  • VOB-tag: /tmp/GROUP_europe
  • VOB storage directory: <WORK>/GROUP_europe.vbs
Create the replica as ownership-preserving
multitool mkreplica -import -workdir /tmp/GROUP_work_dir -tag /tmp/GROUP_europe -vob ~/GROUP_europe.vbs -preserve /opt/rational/clearcase/shipping/ms_ship/incoming/repl_original......
20.Create the VOB mount point and mount the GROUP_europe replica.
mkdir /tmp/GROUP_europe
cleartool mount /tmp/GROUP_europe
21.Make a view called GROUP_Europe_view with storage at <WORK>/GROUP_europe_view.vws.
cleartool mkview -tag GROUP_europe_view /home/host2/GROUP_europe_view.vws
22.Set into the view in the Europe shell and cd to the VOB mount point. Do a directory listing to make sure you are in the VOB. Why don't you see the hello.c file that you created in the original replica?
cleartool setview GROUP_europe_view
cd /tmp/GROUP_europe
ls 
(hello.c was created at the originating VOB after the initial update packet was sent)
23.Make a branch type called europe_branch.
cleartool mkbrtype -c "branch for europe development" europe_branch
24.Set up your configuration specification to isolate your work to the europe_branch or to make branches of the type europe_branch.
cleartool edcs
element * CHECKEDOUT
element * .../europe_branch/LATEST
element * /main/LATEST -mkbranch europe_branch
25.Do a directory listing using cleartool ls to make sure your new rules are in effect.
cleartool ls
Set to the GROUP_usa_view
26.Create an update packet to send to your second replica (GROUP_europe). Use -fship to ship the packet immediately.
multitool syncreplica -export -fship GROUP_europe
Set to the GROUP_europe_view
27.At the second replica (GROUP_europe) do a directory listing of the incoming storage subdirectory /opt/rational/clearcase/shipping/ms_ship/incoming. Did the update packet arrive successfully? Note the other packet that is listed.
ls /opt/rational/clearcase/shipping/ms_ship/incoming
28.Use syncreplica to import the update packet, specifying -receive (to scan the storage bays immediately).
multitool syncreplica -import -receive
29.Do another directory listing of the storage subdirectory. Note that MultiSite deletes update packets as they are applied. Replica-creation packets are not automatically applied and must be manually deleted once you have created/imported the replica.
ls /opt/rational/clearcase/shipping/ms_ship/incoming
30.Delete the replica-creation packet for the replica you imported in Step 19.
rm /opt/rational/clearcase/shipping/ms_ship/incoming/repl_original
31.Do a directory listing in your VOB (/tmp/GROUP_europe). Is hello.c there?
ls
32.Check out hello.c. What version is checked out?
cleartool co -nc hello.c
(/main/second_branch/0 is checked out)
33.Edit hello.c and check it back in.
vi hello.c
cleartool ci -c "added code from second branch" hello.c
34.Export this change to your GROUP_usa replica using syncreplica and the -fship option.
multitool syncreplica -export -fship GROUP_usa
Set to the GROUP_usa_view
35.Import the updates specifically to GROUP_usa, using the -receive and -invob options.
multitool syncreplica -import –invob /tmp/GROUP_usa -receive
36.Use lsvtree to examine the branch structure for hello.c.
cleartool lsvtree -graphical hello.c
37.Check out hello.c from the main branch.
cleartool co -nc hello.c
38.Merge from hello.c@@/main/europe_branch/LATEST to the hello.c@@/main/LATEST version using cleartool merge -to hello.c -ver main/europe_branch/LATEST. Examine the results.
cleartool merge -to hello.c -ver /main/europe_branch/LATEST
39.Check in hello.c.
cleartool ci -c "merged code from europe branch" hello.c
40.Do a cleartool lsvtree -graphical on hello.c to show the versions added and the merge hyperlinks.
cleartool lsvtree -graphical hello.c
41.Export these changes to your GROUP_europe replica, using -fship.
multitool syncreplica -export -fship GROUP_europe
Set to the GROUP_europe_view
42.Import updates to GROUP_europe, using the -receive option.
multitool syncreplica -import –receive
 
Object Mastership
Set to the GROUP_usa_view
1.    Make a label type called LABEL1
cleartool mklbtype -c "Release 1 Label" LABEL1
2.    Using cleartool or multitool describe, get a long description of the label type. How is it mastered?
cleartool describe -l lbtype:LABEL1
(The label is mastered by replica GROUP_usa.)
3.    Export the updates to your GROUP_europe replica.
multitool syncreplica -export -fship GROUP_europe
Set to the GROUP_europe_view
4.    List the label types declared in the VOB.
cleartool lstype -kind lbtype
5.    Import the update packet, using the -receive option.
multitool syncreplica -import -receive
6.    List the label types now declared in the VOB.
cleartool lstype -kind lbtype
7.    Apply LABEL1 to a version of hello.c. (cleartool mklabel LABEL1 hello.c). What happens?
cleartool mklabel LABEL1 hello.c
(You are unable to add this label because replica GROUP_usa is master of LABEL1.)
Set to the GROUP_usa_view
8.    At the GROUP_usa replica use chmaster to transfer mastership of label type LABEL1 to your GROUP_europe replica.
multitool chmaster GROUP_europe lbtype:LABEL1
9.    Export the updates to your GROUP_europe replica.
multitool syncreplica -export -fship GROUP_europe
10.Get long description of LABEL1.
cleartool describe –long lbtype:LABEL1
(LABEL1 is now mastered by GROUP_Europe)
Set to the GROUP_europe_view
11.Import the update. Use the -receive option.
multitool syncreplica -import -receive
12.Get a long description of the label type LABEL1. Where is it mastered now?
cleartool describe -l lbtype:LABEL1
(Mastership now belongs to the GROUP_europe replica.)
13.Apply LABEL1 to a version of hello.c.
cleartool mklabel LABEL1 hello.c
Set to the GROUP_usa_view
14.At the GROUP_usa replica, make a label type, LABEL2 with the following specifications:
·         Make it shared
·         Allow it to be used once-per-branch
cleartool mklbtype -shared -pbranch -c "Label for Release 2" \ LABEL2
15.Export the update to the GROUP_europe replica.
multitool syncreplica -export -fship GROUP_europe
Set to the GROUP_europe_view
16.At your GROUP_europe replica, import the update packet using the -receive option.
multitool syncreplica -import -receive
17.List the label types in the VOB.
cleartool lstype -kind lbtype
18.Apply LABEL2 to hello.c@@/main/LATEST. What happens? Why?
cleartool mklabel LABEL2 hello.c@@/main/LATEST
(You are unable to add label because replica GROUP_usa is master of the main branch)
19.Apply LABEL2 to hello.c@@/main/europe_branch/LATEST. What happens? Why?
cleartool mklabel LABEL2 hello.c@@/main/europe_branch/LATEST
(This branch is owned by replica GROUP_europe and the label is shared, allowing this replica to use it.)
Set to the GROUP_usa_view
20.At the GROUP_usa replica, apply LABEL2 to hello.c@@/main/LATEST.
cleartool mklabel LABEL2 hello.c@@/main/LATEST
21.Open a graphical version tree browser on hello.c. Why doesn't the LABEL2 show up on "europe_branch"?
cleartool lsvtree -graphical hello.c
(The label doesn't show up on europe_branch because you haven't received the last    update packet from the GROUP_europe replica.)
Set to the GROUP_europe_view
22.You next want to inform GROUP_usa about the changes that you've made in GROUP_europe.  From your GROUP_europe replica, export an update packet to GROUP_usa replica.
multitool syncreplica -export -fship GROUP_usa
Set to the GROUP_usa_view
23.At GROUP_usa replica, import the update packet.
multitool syncreplica -import -receive
24.Open a graphical Version Tree Browser on hello.c again. Does the label show up now?
cleartool lsvtree –graphical hello.c
(Yes. The update packet was successfully received.)
25.Create a label type LABEL3.
cleartool mklbtype -c "Label for Release 3" LABEL3
26.Attach the label LABEL3 to hello.c@@/main/LATEST. Export an update packet to your GROUP_europe replica.
cleartool mklabel LABEL3 hello.c@@/main/LATEST
multitool syncreplica -export -fship GROUP_europe
Set to the GROUP_europe_view
27.At the GROUP_europe replica, create a label type LABEL3
cleartool mklbtype –c "Release 3 for Second" LABEL3
(MultiSite warns about a name conflict.)
28.Attach LABEL3 to some version of hello.c on the europe_branch.
cleartool mklabel LABEL3 hello.c
29.Import your update packet. What happens?
multitool syncreplica -import -receive
30.List all label types that are now defined in this replica.
cleartool lstype -l -kind lbtype
31.Export an update packet back to the GROUP_usa replica.
multitool syncreplica -export -fship GROUP_usa
Set to the GROUP_usa_view
32.At GROUP_usa replica, import the update packet using the -receive option. What happens?
multitool syncreplica -import -receive
(MultiSite warns about a name conflict.)
33.List all label types that are now defined in this replica.
cleartool lstype -kind lbtype
34.Is LABEL3 the same type declaration in both VOBs?
No. Both replicas have definitions of LABEL3, but the definitions are not the same.
35.Now fix it. Rename LABEL3. Call it FIRST_LABEL3.  Export your change to the GROUP_europe replica.
cleartool rename lbtype:LABEL3 FIRST_LABEL3
multitool syncreplica -export -fship GROUP_europe
Set to the GROUP_europe_view
36.Import the update.
multitool syncreplica -import -receive
37.Open a cleartool lsvtree -graphical on hello.c. How does the old LABEL3 on /main/LATEST look?
cleartool lsvtree hello.c
 Exercise 2 Solution
Store-and-Forward Facility
 
Set to the GROUP_usa_view
 
1.    At your GROUP_usa replica, create a label type called LABEL4.
cd /tmp/GROUP_usa
cleartool mklbtype -c "Label for Release 4" LABEL4
 
2.    Attach a label of the type LABEL4 to hello.c@@/main/LATEST.
cleartool mklabel LABEL4 hello.c@@/main/LATEST
 
3.    Export the update to your GROUP_europe replica.
multitool syncreplica -export -fship GROUP_europe
 
Set to the GROUP_europe_view
 
4.    Import the update packet.
multitool syncreplica -import -receive
 
5.    Use lsreplica to display a list of replicas, specifying the -long option to show more detail.
cd /tmp/GROUP_europe
multitool lsreplica -l
 
6.    List the history of the GROUP_europe replica to show imports.
cleartool lshistory replica:GROUP_europe
 
7.    Use describe replica:GROUP_europe to see how replica information is reported.
cleartool describe replica:GROUP_europe
 
8.    Use describe vob:vob-tag to show VOB information.
cleartool describe vob:/tmp/GROUP_europe
 
9.    Use describe on element hello.c to see metadata information.
cleartool describe -l hello.c
 
10.Create an attribute called bugnum whose valid values are integers.
cleartool mkattype -c "attribute to hold bug number" -vtype integer bugnum
 
11.Create an update packet, using the -out option to place the packet in a file in your home directory: ~/GROUP_packet
multitool syncreplica -export -out ~/GROUP_packet GROUP_usa
 
12.Use lspacket to show information about the packet, specifying the -long option to show more detail.
multitool lspacket -l
 
13.Use mkorder to create a shipping order for ~/GROUP_packet.
  • The packet is being sent to the PRIMARY host
  • Use the -ship option, placing the shipping order in the outgoing storage bay
Use the -copy option.
/opt/rational/clearcase/etc/mkorder -data ~/GROUP_packet -ship -copy host1
 
14.Ship the packet to the GROUP_usa replica.
/opt/rational/clearcase/etc/shipping_server -poll
 
Set to the GROUP_usa_view
 
15.At the GROUP_usa replica, import the update, specifying the packet file.
multitool syncreplica -import
<