红帽GFS集群文件系统配置指南(3)

四:在共享存储上划分LVM,在一个节点上操作即可

[root@dg51 ~]# fdisk -l /dev/sda (在开始之前,需要将分区改为8e)

Disk /dev/sda: 10.7 GB, 10737418240 bytes
64 heads, 32 sectors/track, 10240 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       10240    10485744   8e  Linux LVM

[root@dg51 ~]# pvcreate /dev/sda1
  Physical volume "/dev/sda1" successfully created
[root@dg51 ~]# vgcreate dg_gfs /dev/sda1
  Clustered volume group "dg_gfs" successfully created
[root@dg51 ~]# vgdisplay dg_gfs
  --- Volume group ---
  VG Name               dg_gfs
  System ID            
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  1
  VG Access             read/write
  VG Status             resizable
  Clustered             yes
  Shared                no
  MAX LV                0
  Cur LV                0
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               10.00 GB
  PE Size               4.00 MB
  Total PE              2559
  Alloc PE / Size       0 / 0  
  Free  PE / Size       2559 / 10.00 GB
  VG UUID               hMivT2-FIuF-QX2N-EXU9-CaZF-wR5a-8QS7t4

[root@dg51 ~]# lvcreate -n gfs1 -l 2559 dg_gfs
  Logical volume "gfs1" created

如果出现下面的错误,在两个节点上重启下clvmd进程即可
[root@dg51 ~]# lvcreate -n gfs1 -l 2559 dg_gfs
  Error locking on node dg52.yang.com: Volume group for uuid not found:

hMivT2FIuFQX2NEXU9CaZFwR5a8QS7t4Ft4RMjI9V6a3jUudYQe0i1IygtIlaHxc
  Aborting. Failed to activate new LV to wipe the start of it.

[root@dg51 ~]# service clvmd restart
Deactivating VG dg_gfs:   0 logical volume(s) in volume group "dg_gfs" now active [  OK  ]
Stopping clvm:  [  OK  ]
Starting clvmd: [  OK  ]
Activating VGs:   0 logical volume(s) in volume group "dg_gfs" now active

[root@dg51 ~]# service clvmd status
clvmd (pid 5494) is running...
active volumes: gfs1 [  OK  ]

[root@dg51 ~]# lvscan
  ACTIVE            '/dev/dg_gfs/gfs1' [10.00 GB] inherit

[root@dg52 ~]# lvscan
  ACTIVE            '/dev/dg_gfs/gfs1' [10.00 GB] inherit

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/psxgs.html