This page is my own personal work. Anyone can use it for their own edification, but must realize that this material is not supported by me and the site is not affiliated with IBM Rational Software or Atlassian.
Convert to the new 4.x CCMS scripts and CC Scheduler.
Old Script | New Script |
sync_sendall.sh | sunc_export_list -all -quiet 1 |
sync_sendall.sh | sync_export_list -quiet 1 -replicas replica-name@vob-tag |
sync_receive.sh,logit.sh | sync_receive -quiet 1 |
sync_recpt.sh | sync_receive -quiet 1 |
Task.Begin Task.Id: 110 Task.Name: "Sync Export Lexington" Task.PathName: sync_export_lex.pl Task.End
# ct schedule -edit -schedule commandThe definitions can be the standard CCMS Sync Export and Import tasks or ones defined above in step (4). Save and close the file.
Set up an alternate storage class.
STORAGE-BAY class-name storage-directory RETURN-BAY class-name return-directory
EXPIRATION class-name days
RECEIPT-HANDLER class-name /path/scriptBack to the INDEX.
Restore a replica from backup.
# mt restorereplica # mt syncreplica -export -fship replica-selector(s) Remote sites have to import and export their own syncreplica commands. Once each remote site has sync'ed back with the local site: # mt syncreplica -import -receive (needed only if automatic RECEIPT-HANDLER not used) # ct unlock vob:vob-tag (only after all sites processed)Some options:
-f.orce | Suppresses the confirmation. |
-invob vob-tag | Specify a VOB other than the current one. |
Handle type naming conflicts.
Set up CCMS on a firewall.
# # Set values for minimum and maximum port numbers. # CLEARCASE_MIN_PORT=min-port CLEARCASE_MAX_PORT=max-portOn a Windows firewall, set them as system environment variables. One should allow a range of at least 4 ports, as the shipping_server will fork if more than one packet is being processed. However, it isn't necessary to specify more than 10, as that is the limit of shipping_server. Remember to set the routing appropriately for all sites. That is, each site needs to send packets to the firewall directly and not the machine on which the remote replica lives. Also, set the routing on the firewall itself. On UNIX, set these in the /var/adm/atria/config/shipping.conf file. On Windows, set them in the CCMS Control Panel.
Set up exceptional-circumstance email notification.
Ensure epoch numbers are not rolled back without restorereplica.
The multitool command.
Interactive: # mt lsepoch ... Non-interactive: # mt multitool> lsepoch ... multitool> quit #Options:
-e | Multitool exits non-interactive mode automatically if an error occurs. |
-ver | Disply the version of multitool and any of its patches. |
-VerAll | In addition to displaying the version, display the version of all libraries used. |
-status | New in CC 2002/5.0, while in non-interactive mode, a 1 or 0 is returned for each subcommand executed. |
Replicate triggers.
# ct mktrtype -type -c "Replicate new triggers to other sites." -postop mktype -trtype -all -exec "ccperl \\machine\share\triggers\trigger_replication.pl" remote_trigger_creator # ct mktrtype -type -c "Remove triggers from other sites." -postop rmtype -trtype -all -exec "ccperl \\machine\share\triggers\trigger_replication.pl" remote_trigger_remover # ct mktrtype -type -c "Rename triggers at other sites." -postop rename -trtype -all -exec "ccperl \\machine\share\triggers\trigger_replication.pl" remote_trigger_renamer
Share the shipping server between CC and CQ.
Determine if CCMS is installed on a particular machine.
Rename or remove a shipping class.
Change the mastership of a CC object.
ct chmaster option(s) new-replica object-selector # If retiring a replica: ct chmaster -all -obsolete_replica old-replica new-replica
Request/enable a change in branch mastership.
Determine/modify the VOB's ACL.
# ct describe replica:relica-name # ct describe brtype:branch-name # ct describe element@branch-pathTo set access on a VOB's ACL:
# mt reqmaster -acl -edit replica:relica-namePossible combinations include an identity-specification and access-level. The identity-specification can be one of the following:
Everyone: | Allow everyone in at the given access level. |
Domain:domain | Allow everyone in the specified domain in at the given access level. |
Group:domain/group | Allow everyone in the specified domain/group in at the given access level. |
User:domain/group/user | Allow the specified domain/group/user in at the given access level. |
Read | Read only access to the VOB's ACL. |
Write | Write access to the VOB's ACL. |
Change | Can request branch change in mastership. |
Full | Same as Read,Write. |
# mt reqmaster { -enable | -disable } replica:replica-nameTo allow/deny a mastership request on a branch or branch type:
CC 4.2-: # mt reqmaster { -deny | -allow } -instances specific-branch CC 5.0+: # mt reqmaster { -deny | -allow } specific-branch # mt reqmaster { -deny | -allow } brtype:branch
Enable requests for branch mastership.
Request mastership of a specific branch during development.
# mt reqmaster element@branch-pathNote that the developer didn't need to know about or specify a replica name. CC will determine the master and send off an appropriate request.
List masterships.
# mt lsmaster replicaOptions:
-kind object-kind[,...] | Limit the listing to a specific type of object, such as brtype. |
-fmt format-string | See the fmt_ccase man page for output formatting options. |
-view view-tag | Use a view other than the default, which uses your current view context. |
-inr.replica { -all | replica[,...] } | Use a specific replica (or all replicas) to retrieve information. |
Share MetaData types.
# ct mk??type -shared type-name
Find all elements mastered by a site.
On Windows: # ct find -all -exec "cleartool describe -fmt \"%[master]p %n\n\" \"%CLEARCASE_PN%\"" | findstr replica On Unix: # ct find -all -exec 'cleartool describe -fmt "%[master]p %n\n" $CLEARCASE_PN' | grep replicaTo find only those elements seen by the current view:
# mt lsmaster -kind felem -fmt "%n\n" replicaBack to the INDEX.
Determine the mastership of an object.
ct describe -fmt "%[master]p" object-selectorBack to the INDEX.
Retransmit a missing packet.
At the import end: # ct lshistory replica:replica-name At the exporting end: # mt recoverpacket -c "Retransmitting some packets." -since time replica-nameThe time can take many forms, such as day-of-the-week, month, H:M:S, etc... Be sure to account for any time-zone differences. Consult the CCMS manual for details.
At the import end: # mt lsepoch replica:export-replica-name At the export end: # mt chepoch import-replica-name export-replica-name=number-given-by-import-admin ex: mt chepoch remote_replica local_replica=100
# mt chepoch -actual import-replica-name
List any packets that might be in a shipping bay.
# mt lspacketOptions:
-s.hort | List only the pathname of the packet. |
-l.ong | Also list the oplog IDs (epoch #s) and creating replica's OID. |
packet-name | Limit the listing to the named packet. Must appear after any options. |
Manually create a shipping order.
# mkorder -data packet-name destination-hostnameThe output will be a file of the name sh_o_packet-name in the current directory. If packet-name contains any colon ":" characters, mkorder will convert them to dots "." automatically so that Windows will accept the shipping order filename. The mkorder command does not use a CC or CCMS license.
-scl.ass class-name | Use the shipping bay for the the storage class class-name. |
-shi.p -cop.y | Place the new shipping order and a copy of packet-name in the shipping bay. |
-fsh.ip [ -cop.y ] | Same as -ship, but shipping server is invoked immediately. The -copy option is optional. |
-out order-name | Use order-name instead of the default sh_o_packet-name |
-pex.pire date-time | Specify a time at which the store-and-forward facility stops trying to send the packet. Default is 14 days. Never expire is 0. See the syncreplica man page for date-time syntax. |
-not.ify email-address | The delivery-failure message is sent to this address. |
Transmit packets generated using -ship.
# shipping_server { -poll | /path/shipping-order }The shipping_server lives in /usr/atria/etc on UNIX and in ccase-home-dir\bin on Windows. The -poll option will assume the outgoing directory of the default shipping bay unless the option "-sclass classname" is given.
List epoch information.
# mt lsepochSome useful options:
-invob vob:vob-tag | Specify a VOB other than the current. |
[replica:]replica-name[@vob-tag] | Only list the row for the specified replica. |
In the following example, there are 3 sites in this CCMS family: replica-name siteA, siteB & siteC. The output of the lsepoch command looks like:
# mt lsepoch Oplog IDs for row "siteC" (@ siteC-server) siteB=221 siteA=709 siteC=653 Oplog IDs for row "siteA" (@ siteA-server) siteB=504 siteA=950 siteC=653 Oplog IDs for row "siteB" (@ siteB-server) siteB=504 siteA=709 siteC=653The output of lsepoch is lines of ascii text. The rows can be mentally arranged in a visual format that better illustrates the information.
updates originating at siteA | updates originating at siteB | updates originating at siteC | |
siteA's own status | 950 | 504 | 653 |
siteA's estimate of siteB | 709 | 504 | 653 |
siteA's estimate of siteC | 950 | 221 | 653 |
Create a custom packet.
# mt mkorder -data filename -fship remote_server
Determine the contents of a sync packet.
# mt lspacket -dump -long packetBack to the INDEX.
Compress synchronization packets.
Create an initial replica.
# mt rename replica:original@SiteA_vob-tag SiteA_replica-name
# mt mkreplica -export -nc -workdir temp-storage-area -fship SiteB_hostname:SiteB_replica-name@SiteA_vob-tag [ SiteC_hostname:SiteC_replica-name@SiteA_vob-tag ]Options used:
-exp.ort | Duplicate an existing VOB. |
-wor.kdir temp-storage-area | Specify a temp area large enough to store an entire copy of the VOB. It cannot exist already and will be deleted after the packet is created. |
-fshi.p | Invoke the shipping server immediately. |
-sh.ip | Generate a packet, but don't send it anywhere yet. |
-max.size size(k, m, or g) | An upper limit to the packet size in kilo, mega or giga bytes. |
-pex.pire date-time | Sets a time after which the store-and-forward facility stops trying to send the packet. Default is 14 days. Never expire is 0. See the syncreplica man page for date-time syntax. |
-tap.e tape-device | Send the output to a tape device instead of the shipping bay. This option is obsolete as of CCMS 5.0. |
-scl.ass class-name | Use the designated storage class instead of the default. |
-out packet-name | Use the designated packet-name instead of the default. |
-notify email-address | The delivery failure message is sent to email-address. |
# mt lspacket -short # mt mkreplica -import -workdir temp-storage-area -tag SiteB_vob-tag -public -preserve -vob SiteB_vob-storage-area packet-nameOptions used:
-imp.ort | Create a new replica. |
-wor.kdir temp-storage-area | Specify a temp area large enough to store an entire copy of the VOB. |
-tag vob-tag | Give the new replica a mount point. Does not need to be the same as the original vob-tag. |
-pre.serve | Use the user (UID) and group (GID) names of the original replica. |
-vob vob-storage-area | Give the new replica a home. |
-npr.eserve | The user doing the import owns the elements. |
-nca.exported (UNIX only) | Assign an export-ID to the new VOB to ensure no "stale NFS handle" across reboots. |
-ign.oreprot | Complete the ownership-preserving import even if permissiom issues arise. |
-poo.ltalk | Specify pool locations and scrubbing parameters other than the defaults. |
-vre.plica replica-name | Specify the replica to be imported if many are bundled in the incoming packet. |
-tap.e tape-device | Look in tape-device instead of a shipping bay. |
-reg.ion -opt.ions -pub.lic -pas.sword -hos.t -hpa.th -gpa.th | See mkvob for explanations. |
-stgloc { storage-location | -auto } | Instead of using -vob, you can specify the vob-storage area by using a registered storage location. The -auto option will select the location automatically. |
-per.ms_preserve [ -nprompt ] | New in CC 2003.06.00. Preserve permissions but not ownership. Can optionally suppress the prompt. |
# cp /usr/atria/config/multisite/sync_recpt.sh /var/adm/atria/config
RECEIPT-HANDLER -default /var/adm/atria/config/sync_recpt.sh
The default UNIX shipping.conf and explanation thereof is stored in shipping.conf.template. On Windows, go to the MultiSite Control Panel and fill in the Receipt Handler Path with ccase-home-dir\config\cron\sync_recpt.bat for CC 3.x and ccase-home-dir\config\scheduler\tasks\sync_receive.bat for CC 4.x.
To sync just one VOB: 15 8,12,16,20 * * * /usr/atria/config/multisite/sync_send.sh SiteA_VOB-tag SiteB_replica-name > /dev/null To sync all VOBs: 15 8,12,16,20 * * * /usr/atria/config/multisite/sync_sendall.sh > /dev/null To run syncreplica independent of a script: 15 8,12,16,20 * * * /usr/atria/bin/multitool syncreplica -export -fship SiteB_replica-name@SiteA_vob-tag > /dev/nullThe max packet size is set in the shipping.conf file and is independent of class.
# ct schedule -edit -schedule
To sync just one VOB: at 03:00AM /every:su <ccase-home-dir>\bin\disprun sync_export_one \vob-tag remote-replica To sync all VOBs: at 03:00AM /every:m,w,f <ccase-home-dir>\bin\disprun sync_exportOn Windows, the max packet size is set in the CCMS Control Panel and is independent of class.
Remove/retire a replica.
# mt chmaster -all -long SiteB-replica-name -or- # mt chmaster -all -obsolete_replica SiteA-replica-name SiteB-replica-name
# mt syncreplica -export -fship SiteB-replica-name
# mt syncreplica -import -receive Test the new masterhsip.
# mt rmreplica SiteA@SiteA-vob-tag
# mt syncreplica -export -fship other-replica-names
# ct rmvob -f vob-storage
Manually sync replicas.
# mt syncreplica -export -fship remote-replica-name@local-vob-tagAt the importing site:
# mt lspacket -short # mt syncreplica -import full-packet-pathnameOther options:
-max.size max-packet-size | On export, limit packet sizes to max-packet-size(k, m, or g). See warning below. |
-max.size max-packet-size -limit num-packets | Same as above, except limit the total number of packets to num-packets. |
-scl.ass storage-class | Export or import, specify the storage class. Available only for -ship and -fship. |
-pex.pire date-time | On Export, designate how long store-and-forward should retry sending. Default is 14 days. Never expire is 0. See the syncreplica man page for date-time syntax. |
-not.ify email-address | The deliver-failure message is sent to email-address. |
-sh.ip | On export, let store-and-forward create the packet in the outgoing bay but not deliver it. |
-fsh.ip | On export, let store-and-forward create the packet and send it immediately. |
-tape raw-tape-device | On export, create the packet on the raw-tape-device. This option is obsolete as of CCMS 5.0. |
-out packet-file | Designate your own packet-file for ftp or other transmission later. |
Change the hostname associated with a replica.
# mt chreplica -host new-hostname replica-nameBack to the INDEX.
Replica/element ownership/permissions.
# mt chreplica { -preserve | -perms_preserve | -npreserve } replica-name@vob-tagBack to the INDEX.
Determine the replica name of a VOB.
ct describe vob:vob-tag ... replica name: replica-name ...If you want to see the replica name only:
ct describe -fmt "%[replica_name]p\n" vob:vob-tag
$current_replica = $vob_o->ThisReplica;
Move a replica.
# mt chreplica -host new-hostname replica-nameBack to the INDEX.
Rename a replica.
# ct rename replica:old-name new-nameBack to the INDEX.
List VOB replicas.
# ct lsreplicaSome useful options:
-l.ong | Include information on the replica's host. |
-s.hort | List only the replica names. |
-fmt format-string | Format the output. See fmt_ccase in the CC Reference Manual. |
-invob vob-tag | Restrict the listing to the replicas of a single VOB. |
-sib.lings | |
$vob_o = $CC->VOB("\\My_Vobtag"); $vob_o->ThisReplica;Warning: The CLI lsreplica will return "original" if the current VOB isn't replicated, whereas CAL ThisReplica returns nothing.
List a replica's properties.
# ct describe replica:replica-nameNew in CC 5.0, the OID of the replica can be used to reference the replica. The specified replica must be at the current site. The replica object OID is the same as the VOB replica UUID.
# ct describe oid:replica-oidBack to the INDEX.
Indicate whether a replica's sibling has IP connectivity.
# mt chreplica { -isconn.ected | -nconn.ected } sibling-replica-nameBack to the INDEX.
Determine the incarnation number of a replica.
# ct dump replica:replica-nameBack to the INDEX.
Find out about unfiltered replica types.
Find all replicated VOBs in a CC region.
# perl -e "foreach (`cleartool lsvob -s`) { print \"\n$_\"; system(\"cleartool lsreplica -s -invob $_\"); }"Back to the INDEX.
Switch a replica to managed mode.
mt syncserver -manage -vob vob-tag
Run syncreplica from a remote host.
Get details about oplog events.
mt dumpoplog -vreplica replica-name -since date-time > replica-name.log
Get a replica's history
ct lshistory replica:replica-name@vob-tagBack to the INDEX.