copyright, 2006 dipl. inform. uwe satthoff 1. basic concepts for usage 2. basic concepts for...

34
Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006 - 28.09.2006 12.10.2006 - 13.10.2006 Configuration Management with ClearCase

Upload: makayla-hurst

Post on 26-Mar-2015

223 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

1. Basic concepts for usage2. Basic concepts for administration3. Setup of example environment

27.09.2006 - 28.09.200612.10.2006 - 13.10.2006

Configuration Managementwith ClearCase

Page 2: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

Configuration Managementwith ClearCase

Basic concepts for administration

Page 3: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase environment

Page 4: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

VOBs appear in views as ordinary directory trees

Page 5: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase client server system

Registry host (registers view, vobs, clients,...)

License host (floating user lics)

Backup registry host

VOB host

View host (optional WEB server)

Client host

Release host

most often on same host

avoid same host !!

host at different location !!

same host, different hosts,central view server host

ClearCase installation NOT required

Page 6: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase network

CC client workstation

CC registry, license server

CC VOB server CC View server

cleartool hostinfo -long

Page 7: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

Exercises:

Planning first : naming conventions, storage locations, accounts, groups, ... create a VOB

cleartool mkvob -tag /vobs/name -public /<storage>/vobstore/name.vbs cleartool mkvob -tag /vobs/priv /<storage>/vobstore/priv.vbs

mount the VOB cleartool mount /vobs/name what is difference between public and private VOB ?

create a view cleartool mkview -tag name /<storage>/viewstore/name.vws

start the view cleartool setview name

list existing processes serving VOBs and Views ps -ef | grep server list the /view directory (ls -la /view) list VOB and view storage directories

Page 8: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

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 processes

db_server (database server) process VOB db transactions (started by albd on request)

vobrpc_server (remote procedure call server) handle requests from view_server processes forward pool access to vob_server

view_server (for each view on host of view storage) started by albd, remains active until endview / rmview

vob_server (one for each VOB)

Page 9: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase host configuration

/opt/rational/clearcase/...

/usr/atria -> /opt/rational/clearcase

/var/adm/rational/clearcase/...

/var/adm/atria -> /var/adm/rational/clearcase

/var/adm/rational/clearcase/rgy/...

/var/adm/rational/clearcase/config/...

/var/adm/rational/clearcase/schedule/...

Page 10: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

Exercises: host configuration

Examine the /opt/rational/clearcase/... Directories etc, config subdirectories

Examine the /var/adm/rational/clearcase/... Directories rgy, config, schedule, log subdirectories

Discussion: How to protect /var/adm directories and files to permit other users than root to administer ClearCase ? Use a special group, e.g. ccadmin

Include /var/adm/rational/clearcase in the backup of ClearCase !! , because ClearCase installation may overwrite your settings.

Page 11: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase VOB parameter

VOB tag

VOB storage

db database

sfile storage

dderived objects

ctext cache

mount pointaccess

meta data

versions‘ containers

access cache

Page 12: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase View parameter

View storage

db database

.sview privates

config specaccess filter

View tag

view referenceaccess

internal admin

checkouts, temporary data The most

important part

Page 13: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase registry

Region 1

VOB tag

VOB tag

VOB tag

View tag

View tag

View tag

View storage

Region 2

VOB tag

VOB tag

VOB tag

View tag

View tag

View tag

Region n

VOB tag

VOB tag

VOB tag

View tag

View tag

View tag

VOB storageView storage VOB storage

Page 14: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

Exercises: VOB and View parameter

list existing regions cleartool lsreg

create a new region cleartool mkregion <region name> why multiple regions ?

register Vobs and Views in new region cleartool mktag -vob ... cleartool mktag -view ...

multiple registries with their regions why / when multiple registries ?

how to organize ClearCase environment with registry / regions ?

Page 15: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

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 time view access mode (read/write , read-only)

cleartool chview ....

Page 16: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase hierarchy of command permissions

ClearCase uses a hierarchy of users for individual command permissions: superuser (root) VOB owner element owner owner of meta data type object creator of version or derived object members of an element’s group anyone

for example, the cleartool rmelem command can be executed by the element owner and anyone higher in the hierarchy

Page 17: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

Exercises: Maintain VOB owner, groups

change VOB owner, add, delete groupscleartool protectvob ....

Maintain VOB elements change element’s owner, group, permission

cleartool protect .... change element’s type

cleartool chtype .... Maintain other VOB objects like, types, branches

rename a type object -> what really happens ?cleartool rename .....

Change owner, group of types, branches, cleartool protect .....

Combine all changes with the find command cleartool find . ... -exec ‘cleartool protect ...’

Page 18: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase VOB maintenance

VOB physical storage

VOB realcontents

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 request

real contents

physical storage

periodically runningby CC scheduler

Page 19: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase VOB maintenance create a VOB

cleartool mkvob -tag <name> <VOB storage> cleartool mkvob -tag <name> -host ... -hpath ... -gpath ... <access path>

before deleting, moving a VOBALWAYS UNMOUNT it everywhere

delete a VOB cleartool 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 processes

move a VOB reformatvob -dump ...; cleartool unregister -vob ....; ct rmtag -vob reformatvob -load ....; cleartool register -vob ....; ct mktag -vob ...

Page 20: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase View maintenance create a View

cleartool mkview -tag <name> <VOB storage> cleartool mkview -tag <name> -host ... -gpath ... <access path>

before moving a Viewstop the view (cleartool endview -server ...)

delete a View cleartool 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 process

move a View cleartool endview ....; cleartool unregister -view ...; cleartool rmtag -view cleartool register -view ....; cleartool mktag -view ...

Page 21: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

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 deleted

the 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

Page 22: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

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_server copy vob storage directory (before check for remote pools) cleartool mount <VOB tag> cleartool unlock vob:<VOB tag>

Page 23: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase backup VOB backup - another procedure using VOB snapshots

reduces the time of the VOB lock a 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_snapshot it 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_dir

make sure, that the snap_dir is backed up by normal backup procedures .....

Page 24: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase backup VOB backup - another procedure using VOB snapshots

reduces the time of the VOB lock a 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_snapshot it 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_dir

make sure, that the snap_dir is backed up by normal backup procedures .....

The VOB snapshot backup is only listed for completness The author does NOT recommend to use it !!

Page 25: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase backup

VOB restore of a complete VOB cleartool umount <VOB tag> on all hosts kill the vob_server, vobrpc_server, db_server processes save the current VOB storage to some place; after that DELETE original restore the VOB storage from backup to ist original location cleartool mount <VOB tag> on hosts where needed

Hint: Try to establish backup via file system snapshot utilities, e.g. Veritas netbackup.

Page 26: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase backup

VOB restore of only some elements you can NEVER have a copy of a VOB in the same registry therefore: use a different host with a different CC registry restore VOB from backup cleartool 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 registry cleartool 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

Page 27: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase backup View backup

before you copy the view storage directory the view_server should be stopped to avoid further changes during the backupcleartool endview -server <view tag>

use any backup utility to copy the view storage after 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 ?

Page 28: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

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 original restore the view storage from backup start 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 recovery use ‘cleartool recoverview -synchronize -tag <view tag>’ to synchronize the

view with all VOBs, in which this view has created view private files

Page 29: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase desaster recovery Use the ClearCase backup registry server as your backup host ClearCase must be installed on this host have a subset of your ClearCase licenses assigned to your backup

host in case of recovery: try to use hostname of original VOB host for

your backup host -> re-registering of VOBs not necessary store 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

Page 30: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

The ClearCase scheduler The central schedule command

cleartool 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 arguments The scheduler is available on any host that runs the albd server The 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 100 user defined tasks start with task id 100

Page 31: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

Exercises: ClearCase scheduler

cleartool schedule -get -acl cleartool schedule -edit -acl cleartool schedule -get -schedule cleartool schedule -edit -schedule cleartool schedule -get -tasks cleartool schedule -edit -tasks

the last two command invocations can be replaced byvi /var/adm/rational/clearcase/scheduler/tasks/task_registry

how to integrate the CC backup in the scheduler ??

Page 32: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

ClearCase customization by triggers

Trigger types in ClearCase element trigger: attached to specific elements all element trigger: attached to ALL elements in a VOB, existing elements and

newly created elements Triggers “fire” on ClearCase commands

post operation: trigger fires after command execution pre operation: trigger fires before command execution, with exit != 0 it refuses

command execution Triggers can be restricted

by 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 users

Trigger action => cleartool command or script

Page 33: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

Exercises: ClearCase triggers

Have a look to the manual page cleartool man mktrtype

a pre checkin all element trigger type named PreCheckin cleartool mktrtype -all -element -pre checkin -nuser ccadmin -exec ‘exit 1’

PreCheckin what does it do ?

Create your own trigger types and test them do not permit anybody to remove elements with command rmelem attach label IN_WORK to new version after checkin

Two triggers recommended as standard in all VOBs remove_empty_branch avoid_evil_twin

Page 34: Copyright, 2006 Dipl. Inform. Uwe Satthoff 1. Basic concepts for usage 2. Basic concepts for administration 3. Setup of example environment 27.09.2006

Copyright, 2006Dipl. Inform. Uwe Satthoff

QUESTIONSQUESTIONS&&

ANSWERSANSWERS