在集群节点上创建lvm
此步骤在一台节点上执行即可,例如在192.168.1.130上执行:
查看共享存储:
#fdisk-l
Disk/dev/sda: 599.0 GB, 598999040000 bytes
255heads, 63 sectors/track, 72824 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x000de0e7
Device Boot Start End Blocks Id System
/dev/sda1 * 1 66 524288 83 Linux
Partition1 does not end on cylinder boundary.
/dev/sda2 66 72825 584434688 8e Linux LVM
Disk/dev/mapper/vg01-lv01: 53.7 GB, 53687091200 bytes
255heads, 63 sectors/track, 6527 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk/dev/mapper/vg01-lv_swap: 537.7 GB, 537676218368 bytes
255heads, 63 sectors/track, 65368 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk /dev/sdb: 1073.7 GB, 1073741824000 bytes
255heads, 63 sectors/track, 130541 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk /dev/sdc: 1073.7 GB, 1073741824000 bytes
255heads, 63 sectors/track, 130541 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk /dev/sdd: 1073.7 GB, 1073741824000 bytes
255heads, 63 sectors/track, 130541 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk /dev/sde: 1073.7 GB, 1073741824000 bytes
255heads, 63 sectors/track, 130541 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk /dev/sdf: 1073.7 GB, 1073741824000 bytes
255heads, 63 sectors/track, 130541 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk /dev/sdg: 1073.7 GB, 1073741824000 bytes
255heads, 63 sectors/track, 130541 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
Disk/dev/mapper/vg01-lv_bmc: 5368 MB, 5368709120 bytes
255heads, 63 sectors/track, 652 cylinders
Units= cylinders of 16065 * 512 = 8225280 bytes
Sectorsize (logical/physical): 512 bytes / 512 bytes
I/Osize (minimum/optimal): 512 bytes / 512 bytes
Diskidentifier: 0x00000000
共6个lun,每个1TB。
创建集群物理卷:
root@t-lg-kvm-001:/root#pvcreate/dev/sdb
root@t-lg-kvm-001:/root#pvcreate/dev/sdc
root@t-lg-kvm-001:/root#pvcreate/dev/sdd
root@t-lg-kvm-001:/root#pvcreate/dev/sde
root@t-lg-kvm-001:/root#pvcreate/dev/sdf
root@t-lg-kvm-001:/root#pvcreate/dev/sdg
创建集群卷组:
root@t-lg-kvm-001:/root#vgcreatekvmvg /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg
Clustered volume group "kvmvg"successfully created
root@t-lg-kvm-001:/root#vgs
VG #PV #LV #SN Attr VSize VFree
kvmvg 6 0 0 wz--nc 5.86t 5.86t
vg01 1 3 0 wz--n- 557.36g 1.61g
创建集群逻辑卷:
root@t-lg-kvm-001:/root#lvcreate -L 5998G -n kvmlv kvmvg
Logical volume "kvmlv" created
root@t-lg-kvm-001:/root#lvs
LV VG Attr LSize Pool Origin Data% Move LogCpy%Sync Convert
kvmlv kvmvg -wi-a----- 5.86t
lv01 vg01 -wi-ao---- 50.00g
lv_bmc vg01 -wi-ao---- 5.00g
lv_swap vg01 -wi-ao---- 500.75g
到此集群的逻辑卷创建完成,逻辑卷在一台节点上创建完成后,在其他节点上都能看到。
可登陆到其他节点上,使用lvs都能查看到该逻辑卷,验证是否成功。