wiki:jazz/09-07-20

2009-07-20

  • [公務] Hadoop 實驗平台加裝 1.5T 硬碟,並測試設定 LVM2
    ~# apt-get install lvm2
    ~# cat /proc/partition
    major minor  #blocks  name
    
      8   0  160836480  sda
      8   1  159180021  sda1
      8   3   1654695  sda3
      8  16   312571224 sdb
      8  17   312568641 sdb1
      8  32  1465138584  sdc
    ~# cfdisk /dev/sdc
    ~# cat /proc/partition
    major minor  #blocks  name
    
       8     0  160836480 sda
       8     1  159180021 sda1
       8     3    1654695 sda3
       8    16  312571224 sdb
       8    17  312568641 sdb1
       8    32 1465138584 sdc
       8    33 1465136001 sdc1
    ~# pvcreate /dev/sdc1
    ~# pvdisplay
      --- Physical volume ---
      PV Name               /dev/sdc1
      VG Name               hadoop
      PV Size               1.36 TB / not usable 897.00 KB
      Allocatable           yes (but full)
      PE Size (KByte)       4096
      Total PE              357699
      Free PE               0
      Allocated PE          357699
      PV UUID               zW4cyi-1jKf-zug9-FcnG-ReVd-82W2-WGdwFP
    ~# vgcreate hadoop /dev/sdc1
    ~# vgdisplay
      --- Volume group ---
      VG Name               hadoop
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  2
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                1
      Open LV               0
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               1.36 TB
      PE Size               4.00 MB
      Total PE              357699          <====== 等一下會用到這個數字
      Alloc PE / Size       357699 / 1.36 TB
      Free  PE / Size       0 / 0
      VG UUID               PTdhAu-cGBn-ZoWh-hL9u-MQ0F-enKT-DOcEtC
    ~# lvcreate -l 357699 -n hadoop-home hadoop
    ~# lvdisplay
      --- Logical volume ---
      LV Name                /dev/hadoop/hadoop-home <======= LVM2 裝置的路徑
      VG Name                hadoop
      LV UUID                0C1hUa-QVJW-mAGL-ygtu-DoIL-6Cmi-viGZ8k
      LV Write Access        read/write
      LV Status              available
      # open                 0
      LV Size                1.36 TB
      Current LE             357699
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           254:0
    ~# mkfs.ext3 /dev/hadoop/hadoop-home
    ~# mount /dev/hadoop/hadoop-home /mnt/
    ~# 
    

LVM

High Availability

Virtualization

Last modified 15 years ago Last modified on Jul 23, 2009, 6:23:44 PM