4 VOBs appear in views as ordinary directory trees
5 ClearCase client server system Registry host (registers view, vobs, clients,...)License host (floating user lics)Backup registry hostVOB hostView host (optional WEB server)Client hostRelease hostmost often on same hosthost at different location !!avoid same host !!same host, different hosts, central view server hostClearCase installation NOT required
7 Exercises:Planning first : naming conventions, storage locations, accounts, groups, ...create a VOBcleartool mkvob -tag /vobs/name -public /<storage>/vobstore/name.vbscleartool mkvob -tag /vobs/priv /<storage>/vobstore/priv.vbsmount the VOBcleartool mount /vobs/namewhat is difference between public and private VOB ?create a viewcleartool mkview -tag name /<storage>/viewstore/name.vwsstart the viewcleartool setview namelist existing processes serving VOBs and Viewsps -ef | grep serverlist the /view directory (ls -la /view)list VOB and view storage directories
8 ClearCase server processes albd (Atria Location Broker Daemon)runs on each ClearCase host, starts on ClearCase startup (root)the master server process (lic manager on license host)lockmgr (lock manager)runs on each VOB host, starts on ClearCase startup (root)grant access to VOBs for db_server and vobrpc_server processesdb_server (database server)process VOB db transactions (started by albd on request)vobrpc_server (remote procedure call server)handle requests from view_server processesforward pool access to vob_serverview_server (for each view on host of view storage)started by albd, remains active until endview / rmviewvob_server (one for each VOB)
10 Exercises: host configuration Examine the /opt/rational/clearcase/... Directoriesetc, config subdirectoriesExamine the /var/adm/rational/clearcase/... Directoriesrgy, config, schedule, log subdirectoriesDiscussion: How to protect /var/adm directories and files to permit other users than root to administer ClearCase ?Use a special group, e.g. ccadminInclude /var/adm/rational/clearcase in the backup of ClearCase !! , because ClearCase installation may overwrite your settings.
12 ClearCase View parameter view referenceaccessView storagedbdatabase.sview privatesconfig specaccess filterView taginternal admincheckouts, temporary dataThe most important part
13 ClearCase registry Region 1 Region 2 Region n VOB tag View tag VOB tag View storageVOB storageVOB storageView storage
14 Exercises: VOB and View parameter list existing regionscleartool lsregcreate a new regioncleartool mkregion <region name>why multiple regions ?register Vobs and Views in new regioncleartool mktag -vob ...cleartool mktag -view ...multiple registrieswith their regionswhy / when multiple registries ?how to organize ClearCase environment with registry / regions ?
15 ClearCase permission levels ClearCase implements a multi level permission system. From “outer level” to “inner level” this are:VOB storage directory (the .identity directory = VOB groups)cleartool protectvob ....VOB element access (rwx modes on VOB elements)cleartool protect ....view protections (rwx of view storage directory)depends on umask settings at view creation timeview access mode (read/write , read-only)cleartool chview ....
16 ClearCase hierarchy of command permissions ClearCase uses a hierarchy of users for individual command permissions:superuser (root)VOB ownerelement ownerowner of meta data type objectcreator of version or derived objectmembers of an element’s groupanyonefor example, the cleartool rmelem command can be executed by the element owner and anyone higher in the hierarchy
17 Exercises: Maintain VOB owner, groups Maintain VOB elements change VOB owner, add, delete groups cleartool protectvob ....Maintain VOB elementschange element’s owner, group, permission cleartool protect ....change element’s type cleartool chtype ....Maintain other VOB objects like, types, branchesrename a type object -> what really happens ? cleartool rename .....Change owner, group of types, branches, cleartool protect .....Combine all changes with the find commandcleartool find exec ‘cleartool protect ...’
18 ClearCase VOB maintenance A VOB is like a ballon.VOB scrubber deletes unnecessary contents, but physical storage remains allocated -until physical size is reduced by reformatvob to the real size which again will grow on requestperiodically runningby CC schedulerVOB physical storageVOB real contentsphysical storagereal contents
19 ClearCase VOB maintenance create a VOBcleartool mkvob -tag <name> <VOB storage>cleartool mkvob -tag <name> -host ... -hpath ... -gpath ... <access path>before deleting, moving a VOB ALWAYS UNMOUNT it everywheredelete a VOBcleartool rmvob [-force] <VOB storage directory>NEVER use ‘rm -rf <vob storage>’ !!!!!But anyhow :-) in case of ....cleartool unregister -vob -uuid <vob uuid>cleartool rmtag -vob <vob tag>; and don’t forget to kill the processesmove a VOBreformatvob -dump ...; cleartool unregister -vob ....; ct rmtag -vobreformatvob -load ....; cleartool register -vob ....; ct mktag -vob ...
20 ClearCase View maintenance create a Viewcleartool mkview -tag <name> <VOB storage>cleartool mkview -tag <name> -host ... -gpath ... <access path>before moving a View stop the view (cleartool endview -server ...)delete a Viewcleartool rmview [-force] <view storage directory> | -tag <view tag>NEVER use ‘rm -rf <view storage>’ !!!!!But anyhow :-) in case of ....cleartool unregister -view -uuid <vob uuid>cleartool rmtag -view <vob tag>; and don’t forget to kill the view processmove a Viewcleartool endview ....; cleartool unregister -view ...; cleartool rmtag -viewcleartool register -view ....; cleartool mktag -view ...
21 ClearCase View maintenance Always have in mind: except checked out data, a view is a temporary storage of data (often mis-used as permanent storage)cleartool lsview -properties [ -full | -age ] ....Never delete a view with checkouts !!!A view with checkouts has been deletedthe VOB still references the checkouts ! - how to get rid of it ?=> cleartool rmview -uuid <view uuid>where view uuid is retrieved by ‘cleartool describe -long vob:<VOB tag>’a view can be moved even in case it has checkouts (same to VOBs)because checkouts are tracked by VOB/View uuids and NOT pathnames
22 ClearCase backup VOB backup before backing up a VOB, LOCK it with command ‘cleartool lock vob:<VOB tag>’ !!!!To copy the VOB storage directory NEVER use copy commands, which modifies the access time !!!!this would disable a correct VOB scrubbing -> VOB size increases !E.g. gtar --atime-preserve ....Steps for backup:cleartool lock vob:<VOB tag>cleartool unmount <VOB tag>kill -9 vob_server; kill -9 vobrpc_server; kill -9 db_servercopy vob storage directory (before check for remote pools)cleartool mount <VOB tag>cleartool unlock vob:<VOB tag>
23 ClearCase backup VOB backup - another procedure using VOB snapshots reduces the time of the VOB locka VOB has to be prepared for snapshot backup with command <CC install dir>/etc/vob_snapshot_setup -snap_to <dir> ... <VOB tab>it has to be scheduled in the CC scheduler command is vob_snapshotit locks the VOB; copies the database (the db directory) to the snap_dir (but it uses tar - BAD); unlocks the VOB; afterwards the VOB pools are copied to the snap_dirmake sure, that the snap_dir is backed up by normal backup procedures.....
24 ClearCase backup VOB backup - another procedure using VOB snapshots reduces the time of the VOB locka VOB has to be prepared for snapshot backup with command <CC install dir>/etc/vob_snapshot_setup -snap_to <dir> ... <VOB tab>it has to be scheduled in the CC scheduler command is vob_snapshotit locks the VOB; copies the database (the db directory) to the snap_dir (but it uses tar - BAD); unlocks the VOB; afterwards the VOB pools are copied to the snap_dirmake sure, that the snap_dir is backed up by normal backup procedures.....The VOB snapshot backup is only listed for completnessThe author does NOT recommend to use it !!
25 ClearCase backup VOB restore of a complete VOB cleartool umount <VOB tag> on all hostskill the vob_server, vobrpc_server, db_server processessave the current VOB storage to some place; after that DELETE originalrestore the VOB storage from backup to ist original locationcleartool mount <VOB tag> on hosts where neededHint: Try to establish backup via file system snapshot utilities, e.g. Veritas netbackup.
26 ClearCase backup VOB restore of only some elements you can NEVER have a copy of a VOB in the same registrytherefore: use a different host with a different CC registryrestore VOB from backupcleartool register -vob ...; cleartool mktag -vob ...; cleartool mount ...create a temporary VOB: cleartool mkvob -tag ....;relocate needed elements from restored VOB to temporary VOB cleartool relocate <source in restored VOB> <target in temporary VOB>cleartool umount <tmp VOB>; kill vob_server, ....copy temporary VOB storage to host of target registrycleartool register -vob <temporary VOB storage>; cleartool mktag ....Use again cleartool relocate from temporary VOB to original target VOB to restore requested elements to their original location
27 ClearCase backup View backup before you copy the view storage directory the view_server should be stopped to avoid further changes during the backup cleartool endview -server <view tag>use any backup utility to copy the view storageafter backup start the view_server process cleartool startview <view tag>REMARK: if ClearCase is used “the right way” view backups shouldn’t be necessary. Only the importance of view private files determine the necessity of view backups.Discussion: What does this mean for checkouts ?
28 ClearCase backup View restore before you restore the view storage directory:stop the view: cleartool endview -server <view tag>save the current view storage to some place; after that DELETE originalrestore the view storage from backupstart the view : cleartool startview <view tag>IMPORTANT: A restored view may not be in sync with the existing VOBs, e.g. regarding checkouts (references to/from VOBs)use ‘cleartool recoverview -tag <view tag>’ for database recoveryuse ‘cleartool recoverview -synchronize -tag <view tag>’ to synchronize the view with all VOBs, in which this view has created view private files
29 ClearCase desaster recovery Use the ClearCase backup registry server as your backup hostClearCase must be installed on this hosthave a subset of your ClearCase licenses assigned to your backup hostin case of recovery: try to use hostname of original VOB host for your backup host -> re-registering of VOBs not necessarystore the latest backup of your VOBs in the same structure as the VOBs are stored on the original VOB host(s)in case of desaster recovery - do NOT use view backups, but let users create new views
30 The ClearCase scheduler The central schedule commandcleartool schedule -get | -edit [ -schedule | -tasks | -acl ]A job is a task that has been scheduled to run one or more times with a set of argumentsThe scheduler is available on any host that runs the albd serverThe scheduler relies on two data repositories:a database of tasks available for scheduling/var/adm/rational/clearcase/scheduler/tasks/task_repository (a file editable with any editor)a database of jobs, or scheduled tasks/var/adm/rational/clearcase/scheduler/db (a db file only accessible via cleartool schedule)predefined tasks have task ids less 100user defined tasks start with task id 100
31 Exercises: ClearCase scheduler cleartool schedule -get -aclcleartool schedule -edit -aclcleartool schedule -get -schedulecleartool schedule -edit -schedulecleartool schedule -get -taskscleartool schedule -edit -tasksthe last two command invocations can be replaced by vi /var/adm/rational/clearcase/scheduler/tasks/task_registryhow to integrate the CC backup in the scheduler ??
32 ClearCase customization by triggers Trigger types in ClearCaseelement trigger: attached to specific elementsall element trigger: attached to ALL elements in a VOB, existing elements and newly created elementsTriggers “fire” on ClearCase commandspost operation: trigger fires after command executionpre operation: trigger fires before command execution, with exit != 0 it refuses command executionTriggers can be restrictedby restriction list of types (element types, branch types, ...)by inclusion list of types (element types, branch types, ...)by excluded user list: trigger does not fire for specific usersTrigger action => cleartool command or script
33 Exercises: ClearCase triggers Have a look to the manual pagecleartool man mktrtypea pre checkin all element trigger type named PreCheckincleartool mktrtype -all -element -pre checkin -nuser ccadmin -exec ‘exit 1’ PreCheckinwhat does it do ?Create your own trigger types and test themdo not permit anybody to remove elements with command rmelemattach label IN_WORK to new version after checkinTwo triggers recommended as standard in all VOBsremove_empty_branchavoid_evil_twin