ETERNUS SF AdvancedCopy Manager Operator's Guide 13.0 -AIX-
Contents Index PreviousNext

Appendix B Preprocessing and Postprocessing of Replication

This chapter explains the shell scripts that perform the pre- and post-processing of replication in AdvancedCopy Manager.

B.1 Overview 

The shell scripts that perform the pre- and post-processing of replication start before and after replication (copy) processing.

These shell scripts contain processing code required by AdvancedCopy Manager for the copy source volume and copy destination volume.

This chapter describes the setup of preprocessing and postprocessing.

B.2 Preprocessing and Postprocessing of Replication 

The replication preprocessing and postprocessing in AdvancedCopy Manager needs to be performed for both the replication source volume and the replication destination volume. However, the purpose for each is different.

Specific processing performed in preprocessing and postprocessing varies according to the data on the volume. The next section describes the preprocessing and postprocessing of a file system and a database.

B.2.1 Preprocessing and postprocessing for a file system 

The preprocessing and postprocessing for a file system is the unmount processing and mount processing of the file system. (For Windows, the processing consists of allocating and canceling a drive letter.) The preprocessing and postprocessing for the replication source volume ensure the integrity of the replication source data. The preprocessing and postprocessing for the replication destination volume are performed to make access from other processes during synchronization processing and snapshot copying impossible. If no volume is mounted and deactivate, the preprocessing and postprocessing are not performed.

When the replication target volume is a physical disk, the implementation status of the preprocessing and postprocessing for a file system is shown below. This table shows whether preprocessing and postprocessing are performed depending on the command type .It also shows the copy status upon execution of the command.

[Table B.1 Preprocessing and postprocessing for a file system]

Command

Copy status

Source/target

Preprocessing

Postprocessing

Replication start command

(swsrpstartsync)

uncopy or

replication establishment

Source

X

X

target

O--*1

X

Replication making command

(swsrpmake)

equivalence maintenance

Source

O

O

target

X

O--*2

Replication cancellation command

(swsrpcancel)

equivalence maintenance

Source

O

O

target

X

O--*2

Replication establishment

Source

X

X

target

X

X

copying

Source

X

X

target

X

X

Snap shot replication making command

(swsrpmake)

uncopy

Source

O

O

target

O

O


O : executed, X : not executed

The postprocessing for the preprocessing performed in (1) is performed in (2). In the postprocessing in (2), re-mount is performed for the mount point where unmount was performed in the preprocessing in (1).

The preprocessing and postprocessing for a file system can be customized. The processing is started in accordance with the table above when a replication management command is executed. For replication between servers, these scripts are executed by remote execution by TCP/IP in the preprocessing and postprocessing of a volume that is not connected.

The operation image before and after processing is shown in Figure B.1.

[Figure B.1 Snapshot replication processing of snapshot]

If processing other than the standard preprocessing and postprocessing is required in the preprocessing and postprocessing, customize the scripts.

When customizing a script, strictly observe the following rules regarding error code:

Error code

Usage

0-99

Unusable (reserved for AdvancedCopy Manager)

100-255

Usable

When the replication target is the volume group that includes logical volume in which the file system has been built, see "When the replication target is a volume group" and the script of preprocessing and postprocessing has to be customized to execute unmount/mount processing for all logical volume in which the file system has been built.

AdvancedCopy Manager does not support any functions for the preprocessing and postprocessing of a database. You will need to perform your own preprocessing and postprocessing before and after the execution of a AdvancedCopy Manager command.

B.2.2 Preprocessing when replication is executed 

The replication source volume (RepSrcPre.js) and the replication destination volume (RepDstPre.js) are prepared for a pretreatment script, and it is stored in the following directory subordinates. Please customize a script according to the necessity for processing.

In the case of non-cluster operation

/etc/opt/FJSVswsrp/sh directory subordinate

In the case of cluster operation

/etc/opt/FJSVswsrp/<logic node name>/sh directory subordinate

B.2.3 Postprocessing when replication is executed 

The replication source volume (RepSrcPost) and the replication destination volume (RepDstPost) are prepared for a post-processing script, and it is stored in the following directory subordinates. Please customize a script according to the necessity for processing.

In the case of non-cluster operation

/etc/opt/FJSVswsrp/sh directory subordinate

In the case of cluster operation

/etc/opt/FJSVswsrp/<logic node name>/sh directory subordinate

+When the replication target is a volume group

When the volume group containing the logic volume by which the file system was built is a replication object, it is necessary to correct an order processing script.

After making the necessary corrections to the script, convert the exit statements on line 60 of the original volume pre-processing script and line 64 of the replica volume pre-processing script into comments ("#").

If the volume group to be replicated includes a logical volume for which no file system has been built, make the above corrections and then convert the processing statements on lines 212 to 217 of the replica volume post-processing script into comments ("#").

Note that unmount/mount processing to a volume group is not carried out in the state where not customized.

Please correct suitably parameters, options, etc. of the OS command, such as the mount command and the fsck command, according to employment.

If the operation involves activation of the replica volume group, the replica volume post-processing script rewrites (recreatevg) the LVM management information. This processing may take a long time.

+When cluster operation by VERITAS Cluster Server

Customize of a preprocessing and postprocessing script is needed, when performing cluster oprating by VERITAS Cluster Server, and when mount point of original/source volume is registered into cluster transaction.

Please change unmount/mount processing in preprocessing and postprocessing script into offline/online processing of mount point resource.

Moreover, the Volume is actually after doing offline/online of mount point resource and there will be a time difference by the time mount/unmount is done.

Therefore, please add the processing (The Result of sleep and the df Command is observed) meets until mount/unmount is actually done after the location where the success or failure of offline/online is judged.

The examples below show how the preprocessing and postprocessing scripts are modified.

[Example] unmount processing change of source volume preprocessing script (RepSrc.pre)

[lines 70,79,100,109th]

(Before change)

/usr/sbin/umount $mount_point

(after change)

/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name


[Example] unmount wait processing addtion of source volume preprocessing script (RepSrc.pre)

[line 98,128h]

(addition)

mount_status="mounted"
while [ $mount_status = "mounted" ]
do
mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=/dev/***** 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done

[Example] unmount processing change of destination volume preprocessing script (RepDst.pre)

[lines 74,83,104,113rd]

(Before change)

/usr/sbin/umount $mount_point

(after change)

/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name

[Example] unmount wait processing addtion of destination volume preprocessing script (RepDst.pre)

[line 102,132nd]

(addition)

mount_status="mounted"
while [ $mount_status = "mounted" ]
do
mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=/dev/***** 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done

[Example] mount processing change of source volume postprocessing script (RepSrc.post)

[lines 77,86,110,119th]

(Before change)

/usr/sbin/mount $lvname $lv_mount_point

(after change)

/opt/VRTSvcs/bin/hares -online resource-name -sys system-name

[Example] mount wait processing addtion of source volume postprocessing script (RepSrc.post)

[line 104,137th]

(addition)

mount_status="not_mounted"
while [ $mount_status = "not_mounted" ]
do
mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done

[Example] mount processing change of destination volume postprocessing script

[lines 72,81st]

(Before change)

/usr/sbin/mount $lvname $lv_mount_point

(after change)

/opt/VRTSvcs/bin/hares -online resource-name -sys system-name

[Example] mount wait processing addtion of destination volume postprocessing script

[line 99th]

(addition)

mount_status="not_mounted"
while [ $mount_status = "not_mounted" ]
do
mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'`
done


Contents Index PreviousNext

All Rights Reserved, Copyright (C) FUJITSU LIMITED 2002-2006