异地VCS双机全同步方法及步骤详解

 

异地双机容灾常见命令

命令 含义

vxdctl -c mode

找到mater节点

vradmin -l printrvg

查看节点是否是primary,并查看dg和rvg名称

vxrlink -g dgcfsname -i 2 status link1name

查看当前链路复制状态,需要为up to date状态才能停止复制

vradmin -g dgcfsname stoprep rvgcfsname

停止复制,根据提示输入y

vradmin -g dgcfsname  -f stoprep rvgcfsname

强制停止复制,根据提示输入y

vradmin -g dgcfsname  -a startrep rvgcfsname

开始全复制

vradmin -g dgcfsname repstatus rvgcfsname

查看复制状态

 vrstat -g dgcfsname -R 

查看复制速率,会一直刷新,退出时可以按ctrl c

异地双机重新全同步步骤如下

1.查找master节点

[root@TESTSERVER1A ~]# vxdctl -c mode
mode: enabled: cluster active - MASTER
master: TESTSERVER1A

2.登陆master节点,查看当前是否为primary

[root@TESTSERVER1A ~]# vradmin -l printrvg
Replicated Data Set: rvgcfsname
Primary:
        HostName: 10.228.170.154        
        RvgName: rvgcfsname
        DgName: dgcfsname
        datavol_cnt: 11
        vset_cnt: 0
        srl: lvtestsrl
        RLinks:
            name=link1name, detached=off, synchronous=off
Secondary:
        HostName: 10.225.170.154
        RvgName: rvgcfsname
        DgName: dgcfsname
        datavol_cnt: 11
        vset_cnt: 0
        srl: lvtestsrl
        RLinks:
            name=link2name, detached=off, synchronous=off

3.查看当前链路复制状态,需要为up to date状态才能停止复制

[root@TESTSERVER1A ~]# vxrlink -g dgcfsname -i 2 status link1name

Mon 22 Oct 2018 05:02:13 PM WAT
VxVM VVR vxrlink INFO V-5-1-4640 Rlink link1name has 17 outstanding writes, occupying 39 Kbytes (0%) on the SRL
VxVM VVR vxrlink INFO V-5-1-4640 Rlink link1name has 8 outstanding writes, occupying 16 Kbytes (0%) on the SRL
VxVM VVR vxrlink INFO V-5-1-4640 Rlink link1name has 4 outstanding writes, occupying 7 Kbytes (0%) on the SRL
VxVM VVR vxrlink INFO V-5-1-4640 Rlink link1name has 166 outstanding writes, occupying 1762 Kbytes (0%) on the SRL
VxVM VVR vxrlink INFO V-5-1-4467 Rlink link1name is up to date

4.强制停止复制

[root@TESTSERVER1A ~]# vradmin -g dgcfsname  -f stoprep rvgcfsname
VxVM VVR vradmin WARNING V-5-52-285  Secondary or Bunker will become out-of-date.
vradmin: Continue with stoprep (y/n)? y
Message from Primary:
VxVM VVR vxrlink INFO V-5-1-6466 Data volumes are in use. Before restarting replication a complete synchronization of the secondary data volumes must be performed.

5.开始全复制

[root@TESTSERVER1A ~]# vradmin -g dgcfsname  -a startrep rvgcfsname
Message from Primary:
VxVM VVR vxrlink WARNING V-5-1-3359 Attaching rlink to non-empty rvg. Autosync will be performed.
VxVM VVR vxrlink INFO V-5-1-3614 Secondary data volumes detected with rvg rvgcfsname as parent:
VxVM VVR vxrlink INFO V-5-1-6183 lvtestdb:      len=1363148800           primary_datavol=lvtestdb
VxVM VVR vxrlink INFO V-5-1-6183 lvtestmain:    len=629145600            primary_datavol=lvtestmain
VxVM VVR vxrlink INFO V-5-1-6183 lvtestslave:   len=419430400                       primary_datavol=lvsb2
VxVM VVR vxrlink INFO V-5-1-3365 Autosync operation has started

6.查看复制状态

[root@TESTSERVER1A ~]# vrstat -g dgcfsname -R

Mon 22 Oct 2018 05:30:26 PM WAT
Replicated Data Set rvgcfsname:

Data Status:
10.225.170.154: DCM contains 3421056 Kbytes.

Network Statistics:
        Messages                Errors                  Flow Control
        --------                ------                  ------------
#    Blocks  RT(msec) Timeout Stream Memory Delays  NW Bytes  NW Delay Timeout
TESTSERVER1A - SB2B
185237  94840320        17      1126    0       0       11846   1392000   1        18
362633401       97077285        22      2340653 0       0       4       94000     1   24

Mon 22 Oct 2018 05:30:36 PM WAT
Replicated Data Set rvgcfsname:

Data Status:
10.225.170.154: DCM contains 34226088 Kbytes.

Network Statistics:
        Messages                Errors                  Flow Control
        --------                ------                  ------------
#    Blocks  RT(msec) Timeout Stream Memory Delays  NW Bytes  NW Delay Timeout
TESTSERVER1A - SB2B
2703    1383936 16      10      0       0       0       1407000   1        16
0       0       22      0       0       0       0       94000     1        24
Bandwidth Utilization 40.60 Mbps.

 

你可能感兴趣的:(系统维护,系统运维)