Anda di halaman 1dari 6

KONFIGURASI LVM UNTUK SAN MULTIPATH DI ORACLE LINUX / RHEL

Setup Multipath
1. Koneksikan kabel SAN ke server (bisa via SAN switch).
2. Alokasikan LUN untuk host yang akan mengakses SAN.
3. Cek block device yang baru yang dideteksi oleh sistem di /dev/sdX. Kadang diperlukan
reboot mesin agar block device tersebut bisa dideteksi. Alternatifnya bisa menggunakan
perintah:
# echo "- - -" > /sys/class/scsi_host/host0/scan; # gantikan 0 dengan nomor
masing-masing channel

Untuk mengetahui device yang baru gunakan perintah:


# fdisk -l | grep -i disk

4. Pastikan driver dan utilitas multipath sudah terinstal:


# rpm -qa | grep device-mapper-multipath
# yum install device-mapper-multipath

5. Bila file /etc/multipath.conf belum ada, copy dari: /usr/share/doc/device-mapper-multipath-*


cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/multipath.conf

6. Temukan WWID yang perlu ditambahkan di multipath.conf


# scsi_id -g -u /dev/sdX
36001438009b044d90000900000780000

7. Edit file /etc/multipath.conf. Konfigurasi minimal sebagai berikut:


defaults {
user_friendly_names yes
path_grouping_policy

failover

}
blacklist {
wwid "*"
}
blacklist_exceptions {
wwid "36001438009b044d90000900000780000" # nomor wwid
}
multipaths {
multipath {

}
}

Last Updated: 24 Desember 2014

wwid

"36001438009b044d90000900000780000"

alias

asm1

8. Load modul kernel multipath:


# modprobe dm-multipath

9. Start multipath service:


# service multipathd start

10. Jika ada syntax errors atau ada parameter yang tidak berlaku di versi Linux terinstal akan
muncul bila perintah ini dijalankan:
# multipath -d

11. Commit konfigurasi:


# multipath -v2

12. Bila konfigurasi benar akan muncul tampilan semacam berikut:


# multipath -ll
netapp01 (360a9800038303244552b46662f505967) dm-2 NETAPP,LUN
size=1.0T features='3 queue_if_no_path pg_init_retries 50' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=50 status=active
| `- 0:0:1:10 sdc 8:32 active ready running
`-+- policy='round-robin 0' prio=10 status=enabled
`- 0:0:0:10 sdb 8:16 active ready running

13. Bila ada kesalahan pada konfigurasi: /etc/multipath.conf, edit file tersebut kemudian
jalankan:
# service multipathd reload
# multipath -F

### menghapus device yang tidak dipakai

# multipath -d
# multipath -v2

Note: Pastikan utilitas device-mapper sudah update termasuk paket-paket dependency-nya.


Penjelasan lebih detail bisa dibaca di:
https://access.redhat.com/documentation/enUS/Red_Hat_Enterprise_Linux/6/pdf/DM_Multipath/Red_Hat_Enterprise_Linux-6DM_Multipath-en-US.pdf

Last Updated: 24 Desember 2014

Setup LVM
1. Inisialisasi Physical Volume (PV)
# pvcreate /dev/mapper/[nama_alias_device]

Contoh:
# pvcreate /dev/mapper/netapp01
# lvmdiskscan

/dev/mapper/netapp01

1,00 TiB] LVM physical volume

# pvdisplay

"/dev/mapper/netapp01" is a new physical volume of "1,00 TiB"


--- NEW Physical volume --PV Name

/dev/mapper/netapp01

VG Name
PV Size

1,00 TiB

Allocatable

NO

PE Size

Total PE

Free PE

Allocated PE

PV UUID

WkK7g7-PkaP-e5wc-lUDk-n5eF-s4EK-zD2Q9x

...
# pvscan
...
PV /dev/sda3

VG vg_elldrpdb

PV /dev/mapper/netapp01

lvm2 [277,78 GiB / 0

free]

lvm2 [1,00 TiB]

Total: 2 [1,27 TiB] / in use: 1 [277,78 GiB] / in no VG: 1 [1,00 TiB]

2. Membuat Volume Group (VG)


# vgcreate vg_[nama_vg] /dev/mapper/[nama_alias]

Contoh:
# vgcreate vg_netapp01 /dev/mapper/netapp01
# vgdisplay vg_netapp01

--- Volume group --VG Name

vg_netapp01

System ID
Format

lvm2

Metadata Areas

Metadata Sequence No

VG Access

read/write

VG Status

resizable

Last Updated: 24 Desember 2014

MAX LV

Cur LV

Open LV

Max PV

Cur PV

Act PV

VG Size

1,00 TiB

PE Size

4,00 MiB

Total PE

262148

Alloc PE / Size

0 / 0

Free

262148 / 1,00 TiB

PE / Size

VG UUID

tpbs8X-fLHn-xjFn-5Qj6-KOQg-8cKW-e43O6s

# vgscan
Reading all physical volumes.

This may take a while...

Found volume group "vg_elldrpdb" using metadata type lvm2


Found volume group "vg_netapp01" using metadata type lvm2

3. Membuat Logical Volume (LV)


# lvcreate -L [ukuran] -n [nama_lv] [nama_vg]

Contoh:
# lvcreate -L 1T -n lv_netapp01_01 vg_netapp01
Logical volume "lv_netapp01_01" created

Untuk mengetahui nilai Total Physical Extents pada Volume Group bisa menggunakan
perintah:
# vgdisplay [nama_vg] | grep Total PE

Kemudian bisa membuat Logical Volume dengan ukuran sesuai nilai Total PE
# lvcreate -l [nilai_total_pe] [nama_vg] -n [nama_lv]
# lvdisplay

--- Logical volume --LV Path

/dev/vg_netapp01/lv_netapp01_01

LV Name

lv_netapp01_01

VG Name

vg_netapp01

LV UUID

f8KKaB-4A6D-eqdG-5coE-bh4u-ouZM-HFBuTW

LV Write Access

read/write

LV Creation host, time elldrpdb.ptpjb.com, 2014-12-24 11:35:47 +0700


LV Status

available

# open

LV Size

1,00 TiB

Current LE

262144

Segments

Allocation

inherit

Read ahead sectors

auto

Last Updated: 24 Desember 2014

- currently set to

256

Block device

252:3

# lvs
LV

VG

Attr

LSize

Pool Origin Data%

Move Log Copy%

Convert
lv_root

vg_elldrpdb -wi-ao-- 257,78g

lv_swap

vg_elldrpdb -wi-ao--

20,00g

lv_netapp01_01 vg_netapp01 -wi-a---

1,00t

# lvscan
ACTIVE

'/dev/vg_elldrpdb/lv_root' [257,78 GiB] inherit

ACTIVE

'/dev/vg_elldrpdb/lv_swap' [20,00 GiB] inherit

ACTIVE

'/dev/vg_netapp01/lv_netapp01_01' [1,00 TiB] inherit

4. Format Logical Volume:


# mkfs.ext4 /dev/[nama_vg]/[nama_lv]

Contoh:
# mkfs.ext4 /dev/vg_netapp01/lv_netapp01_01
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=1 blocks, Stripe width=16 blocks
67108864 inodes, 268435456 blocks
13421772 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
8192 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000, 214990848
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first.

Use tune2fs -c or -i to override.

5. Menambahkan mount point untuk block device tersebut.


# mkdir /[nama_dir]

Last Updated: 24 Desember 2014

Contoh:
# mkdir /data02

Edit file /etc/dengan menambahkan baris:


/dev/[nama_vg]/[nama_lv]

[nama_dir]

ext4

defaults

1 1

/data02

ext4

defaults

1 1

Contoh:
/dev/vg_netapp01/lv_netapp01_01
# mount [nama_dir]

Contoh:
# mount /data02
# df -h
Filesystem

Size

Used Avail Use% Mounted on

/dev/mapper/vg_elldrpdb-lv_root
254G

210G

32G

87% /

48G

23G

25G

48% /dev/shm

/dev/sda2

485M

54M

406M

/dev/sda1

200M

256K

200M

tmpfs

12% /boot
1% /boot/efi

/dev/mapper/vg_netapp01-lv_netapp01_01
1008G

200M

957G

1% /data02

Note:
Penjelasan lebih detail bisa dibaca di:
https://access.redhat.com/documentation/enUS/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration

Last Updated: 24 Desember 2014

Anda mungkin juga menyukai