異地VCS雙機全同步方法及步驟詳解
阿新 • • 發佈:2018-11-01
異地雙機容災常見命令
命令 | 含義 |
---|---|
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節點
[[email protected] ~]# vxdctl -c mode
mode: enabled: cluster active - MASTER
master: TESTSERVER1A
2.登陸master節點,檢視當前是否為primary
[[email protected] ~]# vradmin -l printrvg Replicated Data Set: rvgcfsname Primary: HostName: 10.228.170.154 <localhost> 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狀態才能停止複製
[[email protected] ~]# 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.強制停止複製
[[email protected] ~]# 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.開始全複製
[[email protected] ~]# 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.檢視複製狀態
[[email protected] ~]# 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.