Basic and quick Replication Setup on two nodes

Posted on July 15, 2011

0


 

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

 

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

  • Create partition table
  • Vxdiskadd DIskname/sda/sdb OR vxdiskadm

 

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

 

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

 

Primary

# vradmin -g DGname createpri RVGname datavolume1,datavolume2 SRLvolume

 

(      The addsec command requires that the data volumes and SRL

                must exist on the Secondary with the same names and lengths
                as the data volumes and SRL on the Primary.
                addsec must be executed from the Primary host.
   Caution: Do not execute the addsec command from the
                Secondary host that is being added to the RDS.
                The Secondary can be created only if the /etc/vx/vras/.rdg
                file on the Secondary host contains an entry for the Primary
                disk group ID.  Before creating the Secondary, this entry is
                validated as part of the addsec command.  A plus character
                (+) entry in the /etc/vx/vras/.rdg file on the Secondary
                host allows addsec command for any disk group ID from any
                remote host to proceed.
                The addsec command creates a Secondary RVG in the disk group
                with the same name as the Primary disk group. If required,
                you can use the option -sdg diskgroup to specify a different

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

Let take the replication status and pause replication

# vradmin –g DG repstatus RVGname

 

#vradmin –g DG pauseREP RVGname

 

 

We can resume the paused replication via below command
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.

 

Run the below command on the primary node.

# 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 local_rvgname

 

12.)                        Increase SRL, View SRL

Increase SRL

# vradmin -g diskgroup resizesrl local_rvgname length

View SRL

# vradmin –g DG repstatus RVGname

 

Advertisements
Posted in: SFHA / VCS