clustermode snapmirror loadshare (2) statistics

(script on linux machine, make sure automatic login on cluster is configured)

#!/bin/bash
echo -n "press enter to start "
#creating mountpoints
echo "creating mountpoints"
sudo mkdir -p /nfs/nfs215
sudo mkdir /nfs/nfs216
sudo mkdir /nfs/nfs217
echo "creating mountpoints done"
echo -n "press enter "
read

 

#creating aggregates
echo "creating aggregates"
ssh monitor@192.168.1.100 aggr create data_01 -nodes centos-01 -diskcount 6
ssh monitor@192.168.1.100 aggr create data_02 -nodes centos-02 -diskcount 6
echo "creating aggregates done"
ssh monitor@192.168.1.100 aggr show

 

echo -n "press enter "
read

 

echo "creating vserver"
ssh monitor@192.168.1.100 vserver create -vserver nfs215 -rootvolume nfs215_root -aggregate data_01 -ns-switch file -nm-switch file -rootvolume-security-style unix -language C
echo "creating vserver done"
ssh monitor@192.168.1.100 vserver show
echo -n "press enter "
read

 

echo "creating interfaces"
ssh monitor@192.168.1.100 net int create -vserver nfs215 -lif lif1 -role data -data-protocol nfs -home-node centos-01 -home-port e0c -address 192.168.1.215 -netmask 255.255.255.0
ssh monitor@192.168.1.100 net int create -vserver nfs215 -lif lif2 -role data -data-protocol nfs -home-node centos-01 -home-port e0c -address 192.168.1.216 -netmask 255.255.255.0
ssh monitor@192.168.1.100 net int create -vserver nfs215 -lif lif3 -role data -data-protocol nfs -home-node centos-02 -home-port e0c -address 192.168.1.217 -netmask 255.255.255.0
echo "creating interfaces done"
echo -n "press enter "
read

 

ssh monitor@192.168.1.100 net int show
echo "switch on nfs"
ssh monitor@192.168.1.100 nfs on -vserver nfs215
echo "switch on nfs done"
echo -n "press enter "
read

 

echo "creating rule "
ssh monitor@192.168.1.100 vserver export-policy rule create -vserver nfs215 -policyname default -clientmatch 192.168.1.160 -rorule any -rwrule any -superuser any
echo "creating rule done"
echo -n "press enter "
read

 

 

echo "creating datavols rw and ls"
ssh monitor@192.168.1.100 vol create -vserver nfs215 -volume vol215 -aggregate data_01 -size 100m -state online -type RW
ssh monitor@192.168.1.100 vol mount -vserver nfs215 -volume vol215 -junction-path /vol215
ssh monitor@192.168.1.100 vol create -vserver nfs215 -volume vol215_ls1 -aggregate data_01 -size 100m -state online -type DP
ssh monitor@192.168.1.100 vol create -vserver nfs215 -volume vol215_ls2 -aggregate data_02 -size 100m -state online -type DP
echo "creating datavols done"
ssh monitor@192.168.1.100 vol show -vserver nfs215
echo -n "press enter "
read

echo "mounting volume source volume set access permissions and write to it"
ssh monitor@192.168.1.100 vol modify -vserver nfs215 -unix-permissions 777 -volume vol215
sudo mount -t nfs 192.168.1.215:.admin/vol215 /nfs/nfs215
sudo touch /nfs/nfs215/a /nfs/nfs215/b /nfs/nfs215/c
ls /nfs/nfs215/
echo "mounting volume done"
echo -n "press enter "
read

echo "creating snapmirror relations and initialize"
ssh monitor@192.168.1.100 snapmirror create -source-path centos://nfs215/vol215 -destination-path centos://nfs215/vol215_ls1 -type ls
ssh monitor@192.168.1.100 snapmirror create -source-path centos://nfs215/vol215 -destination-path centos://nfs215/vol215_ls2 -type ls
ssh monitor@192.168.1.100 snapmirror initialize-ls-set -source-path centos://nfs215/vol215
ssh monitor@192.168.1.100 snapmirror modify -destination-path centos://nfs215/vol215_ls1 -schedule 5min
echo "creating snapmirror relations done"
echo -n "press enter "
read

echo "mounting via other lifs"
sudo mount -t nfs 192.168.1.216:/vol215 /nfs/nfs216
sudo mount -t nfs 192.168.1.217:/vol215 /nfs/nfs217
echo "mounting via other lifs done"
echo -n "press enter "
read
cd /nfs/nfs216
while true ; do ls -lR . > /dev/null; sleep 1; done&
cd /nfs/nfs217
while true ; do ls -lR . > /dev/null; sleep 1; done&
echo -n "press enter "
read

ssh monitor@192.168.1.100 statistics show -object volume -instance vol* -counter read_ops


This entry was posted in netapp. Bookmark the permalink.

Comments are closed.