cdot snapmirror exercise with commands

1. Create a new SVM (SVMcl1) on cluster1 and add a LIF to the SVM: 192.168.0.200

vserver create -vserver SVMcl1 -rootvolume root -aggregate aggr1_n1 -rootvolume-security-style unix
net int create -vserver SVMcl1 -lif lif1 -address 192.168.0.200 -netmask 255.255.255.0 -role data \
-home-node cluster1-02 -data-protocol nfs -home-port e0c

2. Add a 500MB volume (cl1data) to the SVM with junction-path: /data

vol create -vserver SVMcl1 -volume cl1data -aggregate aggr1_n2 -size 500m -junction-path /data

3. Add an export-policy with a rule for the CentOS VM: (192.168.0.10)
Connect the policy to the SVMcl1 root-volume and data-volume
Enable NFS for SVMcl1

export-policy create -vserver SVMcl1 -policyname svmcl1pol
export-policy rule create -vserver SVMcl1 -policyname svmcl1pol -clientmatch 192.168.0.10 \
-rorule any -rwrule any -superuser any
vol modify -vserver SVMcl1 -volume * -policy svmcl1pol
nfs on -vserver SVMcl1

4. Create a new directory on CentOS to be used as an NFS mountpoint: /svmdata
Mount 192.168.0.200:/data /svmdata

mkdir /svmdata
mount 192.168.0.200:/data /svmdata

5. On CentOS: copy all files from /var/log to /svmdata.

cp /var/log/* /svmdata

6. Create a new SVM (SVMcl2) on cluster2 and add a Lif to the SVM: 192.168.0.201

vserver create -vserver SVMcl2 -rootvolume root -aggregate aggr1_n1 \
-rootvolume-security-style unix
net int create -vserver SVMcl2 -lif lif1 -address 192.168.0.201 -netmask 255.255.255.0 -role data \
-home-node cluster2-01 -data-protocol nfs -home-port e0c

7. Add a 500MB volume to the SVM. The VolumeType should be DP: mirdata
You cannot mount the volume because its type is DP.
Add an export-policy with a rule for the CentOS VM: (192.168.0.10)

vol create -vserver SVMcl2 -volume cl2data -aggregate aggr1_n1 -size 500m -type DP
export-policy create -vserver SVMcl2 -policyname svmcl2pol
export-policy rule create -vserver SVMcl2 -policyname svmcl2pol -clientmatch 192.168.0.10 \
-rorule any -rwrule any -superuser any
vol modify -vserver SVMcl2 -volume * -policy svmcl2pol
nfs on -vserver SVMcl2

8. Set up a peering relationship between SVMcl1 and SVMcl2.
In a previous exercise you already created a peering relationship between
the two clusters.

vserver peer create -peer-cluster cluster2 -vserver SVMcl1 -peer-vserver SVMcl2 -applications snapmirror

9. Create a snapmirror relationship between SVMcl1:data and SVMcl2:mirdata. Type: DP.

snapmirror create -source-path SVMcl1:cl1data -destination-path SVMcl2:cl2data -type DP

10. Initialize the relationship.

snapmirror initialize -destination-path SVMcl2:cl2data

11. Make sure the snapmirror update runs every 5 minutes.

snapmirror modify -destination-path SVMcl2:cl2data -schedule 5min

12. Mount SVMcl2:mirdata to junction-path /mirdata

vol mount -vserver SVMcl2 -volume cl2data -junction-path /mirdata

13. On CentOS: create a mountpoint (/svmmirdata) and mount the mirdata volume to /svmmirdata

mkdir /svmmirdata
mount 192.168.0.201:/mirdata /svmmirdata

You should see the files you copied in task 5.

ls /svmmirdata
(output skipped)

14. On CentOS: copy /etc/hosts to /mirdata.
This should fail.

cp /etc/hosts /svmmirdata
cp: cannot create regular file `/svmmirdata/hosts': Read-only file system

15. Break the snapmirror relationship.

snapmirror break -destination-path SVMcl2:cl2data

16. On CentOS: copy /etc/hosts to /mirdata.
This should succeed.

cp /etc/hosts /svmmirdata

17. reverse the snapmirror relationship.

snapmirror resync -destination-path SVMcl1:cl1data -source-path SVMcl2:cl2data

Warning: All data newer than Snapshot copy
snapmirror.af989dfc-7aa7-11e6-acd4-123478563412_2147484697.2016-09-14_2
03500 on volume SVMcl1:cl1data will be deleted.
Do you want to continue? {y|n}: y

This entry was posted in Uncategorized. Bookmark the permalink.

Comments are closed.