Less known Solaris Features: Remote Mirror with AVS - Part 3: Setting up a synchronous mirror with AVS
After this short introduction in the theory of AVS Remote mirror, we will set up such an replication between two hosts.
Prerequisites for this tutorial
In this tutorial we need to work with two systems. I will use theoden and gandalf again.
Both systems have a boot disk and two disks for data. The data disks have a size of 512 MB. In my example this disks are
c1d1. I´ve partitioned each disk in the same manner:
It´s important that the primary and secondary partitions and their respective bitmap paritions are equal in size. Furthermore: Don´t use cylinder 0 for partitions under the control of AVS. This cylinder may contain administrative information from other components of the systems. Replication of this information may lead to data loss.
In my example i´ve choosen a 32 MB bitmap partition for a 512 MB data partition. This is vastly too large for the use case. You will find the exact rule for sizing this parition in the documentation
The first partition
c1dxs0 is used as the bitmap volume. The second volume
c1dxs1 is used as the primary volume on the source of the replication respectivly the secondary volume on the target of the replication.
Setting up the replication
Okay, at first we have to enable AVS on both hosts. At first we activate it on
This command may ask for the approval to create the config database, when you run this command for the first time. Answert this question with
y.After this we switch to gandalf to do the same.
Now we can establish the replication. We login at theoden first, and configure this replication.
What have we configured? We told AVS to replicate the content of
gandalf. AVS uses the
/dev/rdsk/c1d0s1 volume on each system as the bitmap volume for this application. At the end of this command we configure, that the replication uses IP and it´s a synchronous replication.
Okay, but we have to configure it on the targeted system of the replication as well:
We repeat the same command we used on
gandalf as well. Forgetting to do this step is one of the most frequent errors in regard of setting up an remote mirror.
An interesting command in regard of AVS remote mirror is the
dsstat command. It shows the status and some statistic data about your replication.
The 100.00 doesn´t stand for “100% of the replication is completed”. It standing for “100% of the replication to do”. We have to start the replication manually. Okay, more formally the meaning of this column is “percentage of the volume in need of syncing”. And as we freshly configured this replication it´s obivous, that the complete volume needs synchronisation.
Two other columns are important, too: It´s the
t and the
s column. The
t column designates the volume type and the
s the status of the volume. In this case we´ve observed the primary volume and it´s in the logging mode. It records changes, but doesn´t replicate them right now to the secondary volume.
Okay, so let´s start the synchronisation:
We can lookup the progress of the sync with the
dsstat command again:
When we start the syncronisation the status of the volume switches to
SY for synchronizing. After a while the sync is complete. The status switches again, this time to
R for replicating. From this moment all changes to the primary volume will be replicated to the secondary one.
Now let´s play around with our new replication set by using the primary volume. Create a filesystem on it for example, mount it and play around with it:
[root@theoden:~]$ newfs /dev/dsk/c1d0s1Okay, in a few seconds i will show you, that all changes really get to the other side.
newfs: construct a new file system /dev/rdsk/c1d0s1: (y/n)? y
/dev/rdsk/c1d0s1: 968704 sectors in 473 cylinders of 64 tracks, 32 sectors
473.0MB in 30 cyl groups (16 c/g, 16.00MB/g, 7680 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 32832, 65632, 98432, 131232, 164032, 196832, 229632, 262432, 295232,
656032, 688832, 721632, 754432, 787232, 820032, 852832, 885632, 918432, 951232
[root@theoden:~]$ mount /dev/dsk/c1d0s1 /mnt
[root@theoden:~]$ cd /mnt
[root@theoden:~]$ touch test
[root@theoden:~]$ cp /var/log/* .
[root@theoden:~]$ mkfile 1k test2</blockquote>