本文共 6751 字,大约阅读时间需要 22 分钟。
[root@db-xxx-xxx-xxx-xxx ~]# multipath -llmsa_60_vd01vol01 (3600c0ff000da60c23d8a375201000000) dm-3 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:4:1 sdh 8:112 [active][ready] \_ 1:0:4:1 sds 65:32 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:3:1 sdf 8:80 [active][ready] \_ 1:0:3:1 sdq 65:0 [active][ready]msa_62_vd01vol01 (3600c0ff000da60e2f705385201000000) dm-5 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:6:1 sdk 8:160 [active][ready] \_ 1:0:6:1 sdv 65:80 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:5:1 sdj 8:144 [active][ready] \_ 1:0:5:1 sdu 65:64 [active][ready]msa_58_vd01vol01 (3600c0ff000da61d7258a375201000000) dm-1 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:2:1 sdd 8:48 [active][ready] \_ 1:0:2:1 sdo 8:224 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:1:1 sdb 8:16 [active][ready] \_ 1:0:1:1 sdm 8:192 [active][ready]msa_60_vd02vol01 (3600c0ff000da60ca488a375201000000) dm-4 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:3:2 sdg 8:96 [active][ready] \_ 1:0:3:2 sdr 65:16 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:4:2 sdi 8:128 [active][ready] \_ 1:0:4:2 sdt 65:48 [active][ready]msa_58_vd02vol01 (3600c0ff000da6318358a375201000000) dm-2 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:1:2 sdc 8:32 [active][ready] \_ 1:0:1:2 sdn 8:208 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:2:2 sde 8:64 [active][ready] \_ 1:0:2:2 sdp 8:240 [active][ready]msa_57_vd01vol01 (3600c0ff000da62c0be8d375201000000) dm-0 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:0:1 sda 8:0 [active][ready] \_ 1:0:0:1 sdl 8:176 [active][ready]B主机 :
[root@db-xxx-xxx-xxx-xxx ~]# multipath -llmsa_60_vd01vol01 (3600c0ff000da60c23d8a375201000000) dm-3 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:4:1 sdh 8:112 [active][ready] \_ 1:0:4:1 sds 65:32 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:2:1 sdd 8:48 [active][ready] \_ 1:0:2:1 sdo 8:224 [active][ready]msa_62_vd01vol01 (3600c0ff000da60e2f705385201000000) dm-5 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:5:1 sdj 8:144 [active][ready] \_ 1:0:6:1 sdv 65:80 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:6:1 sdk 8:160 [active][ready] \_ 1:0:5:1 sdu 65:64 [active][ready]msa_58_vd01vol01 (3600c0ff000da61d7258a375201000000) dm-1 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:3:1 sdf 8:80 [active][ready] \_ 1:0:1:1 sdm 8:192 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:1:1 sdb 8:16 [active][ready] \_ 1:0:3:1 sdq 65:0 [active][ready]msa_60_vd02vol01 (3600c0ff000da60ca488a375201000000) dm-4 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:2:2 sde 8:64 [active][ready] \_ 1:0:2:2 sdp 8:240 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:4:2 sdi 8:128 [active][ready] \_ 1:0:4:2 sdt 65:48 [active][ready]msa_58_vd02vol01 (3600c0ff000da6318358a375201000000) dm-2 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:1:2 sdc 8:32 [active][ready] \_ 1:0:3:2 sdr 65:16 [active][ready]\_ round-robin 0 [prio=20][enabled] \_ 0:0:3:2 sdg 8:96 [active][ready] \_ 1:0:1:2 sdn 8:208 [active][ready]msa_57_vd01vol01 (3600c0ff000da62c0be8d375201000000) dm-0 HP,MSA2312fc[size=1.4T][features=1 queue_if_no_path][hwhandler=0][rw]\_ round-robin 0 [prio=100][active] \_ 0:0:0:1 sda 8:0 [active][ready] \_ 1:0:0:1 sdl 8:176 [active][ready]
pvscanvgscanlvscan
[root@db-xxx-xxx-xxx-xxx ~]# lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert lv01 vgdata01 -wi--- 8.17T[root@db-xxx-xxx-xxx-xxx ~]# ll /dev/mapper/vgdata01-lv01ls: /dev/mapper/vgdata01-lv01: No such file or directory而在A主机上, lv处于激活状态 :
[root@db-xxx-xxx-xxx-xxx ~]# lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert lv01 vgdata01 -wi-a- 8.17T[root@db-xxx-xxx-xxx-xxx ~]# ll /dev/mapper/vgdata01-lv01 brw-rw---- 1 root disk 253, 6 Sep 17 08:29 /dev/mapper/vgdata01-lv01在B主机上激活逻辑卷的命令, 激活后map device 被自动创建 :
[root@db-xxx-xxx-xxx-xxx ~]# lvchange -ay vgdata01/lv01[root@db-xxx-xxx-xxx-xxx ~]# ll /dev/mapper/vgdata01-lv01brw-rw---- 1 root disk 253, 6 Sep 17 08:54 /dev/mapper/vgdata01-lv01此时可以将A主机卸载,
[root@db-A ~]# umount /dev/mapper/vgdata01-lv01然后在B主机挂载该文件系统
[root@db-B ~]# mount /dev/mapper/vgdata01-lv01 /database1在任意主机上创建的文件, 在另一主机挂载该卷后可以正常访问.
[root@db-B database1]# date +%F%T >>./test[root@db-B database1]# lltotal 20drwx------ 2 root root 16384 Sep 17 08:29 lost+found-rw-r--r-- 1 root root 19 Sep 17 08:57 test[root@db-B database1]# cat test2013-09-1708:57:22将B卸载并冻结lv后, 在A挂载.
[root@db-B ~]# umount /database1[root@db-B ~]# lvchange -an vgdata01/lv01[root@db-A ~]# lvchange -ay vgdata01/lv01[root@db-A ~]# mount /dev/mapper/vgdata01-lv01 /database[root@db-A ~]# cd /database/[root@db-A database]# lltotal 20drwx------ 2 root root 16384 Sep 17 08:29 lost+found-rw-r--r-- 1 root root 19 Sep 17 08:57 test[root@db-A database]# cat test2013-09-1708:57:22
The lv_attr bits are: 1 Volume type: (m)irrored, (M)irrored without initial sync, (o)rigin, (O)rigin with merging snapshot, (s)napshot, merging (S)napshot, (p)vmove, (v)irtual, mirror (i)mage, mirror (I)mage out-of-sync, under (c)onversion 2 Permissions: (w)riteable, (r)ead-only 3 Allocation policy: (c)ontiguous, c(l)ing, (n)ormal, (a)nywhere, (i)nherited This is capitalised if the volume is currently locked against allocation changes, for example during pvmove (8). 4 fixed (m)inor 5 State: (a)ctive, (s)uspended, (I)nvalid snapshot, invalid (S)uspended snapshot, mapped (d)evice present without tables, mapped device present with (i)nactive table 6 device (o)pen
转载地址:http://timfl.baihongyu.com/