on 02-23-2010 09:38 AM
In today’s article we will discuss a Basic and quick Replication Setup on two nodes.
I have done this on Red Hat enterprise4 update 4 and the Storage foundation version is 4.1 with replication license.
Prerequisite
a.) Linux operating System installed.
b.) Red Hat enterprise4 update 4 and the Storage foundation version is 4.1 with replication license installed.
c.) Three drives.One for Operating System, Second for the data drive which you want to be replicated, third for the SRL
d.) Configure vvr with the mentioned command (#cd /opt/VRTS/install ./installvvr –configure)
Steps
·
Disk Partitioning, Writing File System, Viewing and Formating
·
Add the disk into DiskGroup
·
Create Volume, Create Volume in particular Disk
·
Add DCM logs
·
Mount Volume
·
Mount Volume in FSTAB
·
Create RVG
· See SRL size
· Start Replication
· Verify Replicated Contents
· Take Over
· Increase SRL, View SRL
1.)
Disk Partitioning, Writing File System and Formating
Partitioning, Writing File System
# Fdisk /dev//sdb OR fdisk /dev/hdb
Write n for create partition
Write w for write partition table
Click p to check the created partition
View
# Fdisk –l/vxdisk list to view the newly created partition
Format
# mkfs –t ext3 /dev/sdb OR /dev/hdb (this command is to write the filesystem which is ext3)
2.)
Add the disk into DiskGroup
# vxdiskadd sdb/ hdb OR
vxdiskadm OR
Please Note: use vxdisk list command insted of fdisk -l to verify the names(of disks) for adding disk into diskgroup via the command vxdiskadd/vxdiskadm because sometimes the fdisk -l shows different names, and this leads failure in adding disks or retuen error
Note:-
(to check the Disk Group and its volumes)
vxprint will show the result when the disk group are created
ADD new disk in DG
3.)
Create Volume, Create Volume in particular Disk
Create Volume
#vxassist –g mydg make myVolume 1G
Create Volume in particular disk
If you want to create myVolume in particular disk (if you have multiple disk in DIskGroup) so you use
#vxassist –g mydg make myVolume 1G disk001
(where Disk001 is derived from vxprint command, the disk name is at the front of dm OR under DISK from vxdisk list command)
4.)
Add DCM logs
Use the below command to add the dcm logs with volume/partition which will replicate
# vxassist –g mydg make myVolume 1G logtype=dcm(this command will also create volume)
OR
#vxassist –g mydg addlog volume logtype=dcm(this command only create dcm log)
Note:-
The below command will not work if we mention logtype=dcm in the below command because in this command we specify the volume will create in a specific disk but in the below command the dcm log command will conflict with the disk because the dcm required 2 disk bcuz making its mirror
#vxassist –g mydg make myVolume 1G disk001
5.)
Mount Volume
# mount source volume(/dev/vx/dsk/DG/volume1) destination mount point
Note:-
a.)
mount OR df –h to see the mounted volumes
b.)
Before running the #mount command run #mount –a command, this command actually mount all the partitions which are mentioned in the FSTAB
c.)
Run the mount and unmount command under /root
6.)
Mount Volume in FSTAB
The below procedure will keep mount your volumes after computer restart)
Add the volumes in the FSTAB so after reboot the volumes mount again
# vi /etc/fstab
/dev/vx/dsk/DIskGroup/Volume /mnt/vol1 ext3 defaults 0 0
fstab as if primary system down and secondary system tookover the control, after sometime the primary system comes up and secondary(currently primary) already up , will create problems as secondary system try to mount the volumes as per the fstab instruction.
Note:-
a.)
mount OR df –h to see the mounted volumes
b.)
Before running the #mount command run #mount –a command, this command actually mount all the partitions which are mentioned in the FSTAB
c.)
Run the mount and unmount command under /root
7.)
Create RVG
Setup data volume for replication, before doing this you also have a volume for SRL which must not mounted, formatted and must be on different drive.
Note:
Try to keep each volume has a different srl because suppose if one volume fail the replication has to stop and the second volume will suffer.
Primary
# vradmin -g DGname createpri RVGname datavolume1,datavolume2 SRLvolume
( The addsec command requires that the data volumes and SRL
disk group on the Secondary. )
Secondary
Note:- Secondary data volume must not be mounted
# vradmin -g hrdg addsec RVGname PrimaryNODE SecondaryNODE
8.) See SRL size
# vradmin –g DG repstatus RVGname
9.) Start Replication, Replication status commands
Start Replication
# vradmin -g diskgroup -a startrep local_rvgname sec_hostname
Replication status commands
vradmin –g DG repstatus RVGname
vradmin –g DG pauseREP RVGname
vradmin –g DG RESUMErep RVGname
vradmin –g DG stoprep RVGname
OR
Vrstat
# vradmin –g DG repstatus RVGname
#vradmin –g DG pauseREP RVGname
vradmin –g DG RESUMErep RVGname
10.) Verify Replicated Contents
Convert secondary to primary so we can mount the replicated volume and check the contents which were replicated. Otherwise we cant mount the replicated volume.
Before running the below command on the primary node, unmount the partitions from primary first. No need to mount the partition on secondary node which is going to be primary and also pause replication if you have multiple rvgs and every rvgs volumes are dependent on each other
# vradmin -g DG migrate RVGname REMOTEhost_Name
11.) Take Over
Takes over the Primary role from an original Primary with fast failback enabled.
(when primary got dead/corrupted make the secondary the primary)
# vradmin -g diskgroup takeover local_rvgname
Sometimes when we do takeover the configurations got primary - primary when we take repstatus.
So on all tvgs we run the below command:
vradmin -g Dgname fbsync RVGname
12.) Increase SRL, View SRL
Increase SRL
# vradmin -g diskgroup resizesrl local_rvgname length
View SRL
# vradmin –g DG repstatus RVGname
We may change
- Replication Link IP's
TIP:
a.) Before running below command do not change the primary and secondary site replication IP first. First run this below change ip command and then change the replication IP's
b.) Some time this happens that we configure secondary node at primary site(also do replicate completely as we can get good speed on LAN) and then send the secondary node to DR site and at DR site sometimes we have a different subnet so we have to take the IP with a different subnet so when the IP will be changed we cant run the change ip command to change the replication IP, so we can run the command of change IP at primary site before sending the secondary node to secondary/Dr Site.
example = vradmin -g DG changeip RVGname newpri=10.0.0.1 newsec=10.0.0.2
Please Note: Now the rlink name may change(may reflect old IP) when run the vxprint command but its just name
- Packet SIze
example
# vradmin -g DG set RVG Sec_host protocol=UDP
# vradmin -g DG set RVG Sec_host packet_size=1400
Verify Packet Size:
# vxprint -l | grep packet_size
info: timeout=500 packet_size=1400 rid=0.1065
Some help ful link:
http://sfdoccentral.symantec.com/sf/5.0/aix/html/vvr_admin/ag_ch_setupreplication_vvr6.html
hy,
i put this solution with the same versions (RHEL and SF), it runs really good. The architecture is replication from 2 hosts to a host.
The customer is happy.
Every quarter, we test a migrate, it is always a great succes for the customer IT team.
regards,
Hervé
Thanks for your kind comment
Zahid,
Did you missed to add diskgroup authentication ?
Gaurav
Yes you right. I missed it :(
Thanks for your kind words