Multipath — способ доступа к устройству массового хранения, при котором к нему от центрального процессора ведёт несколько путей. Используется для повышения отказоустойчивости и распределения нагрузки. В Linux реализован при помощи специального драйвера device-mapper'а.
Cek HBA WWN nya # cat /proc/scsi/qla2xxx/2 |grep port scsi-qla1-adapter-port=210000145e24e4d5; # cat /proc/scsi/qla2xxx/1 |grep port scsi-qla0-adapter-port=210000145e24e4d4; Cek Aplikasi Device mapper & Installasi # rpm -qa|grep device-mapper # wget ftp://ftp.pbone.net/mirror/ftp.centos.org/4.6/os/i386/ CentOS/RPMS/device-mapper-multipath-0.4.5-27.RHEL4.i386.rpm # wget ftp://ftp.pbone.net/mirror/ftp.centos.org/4.6/os/i386/ CentOS/RPMS/sysfsutils-1.2.0-1.i386.rpm # rpm -ivh sysfsutils-1.2.0-1.i386.rpm # rpm -ivh device-mapper-multipath-0.4.5-27.RHEL4.i386.rpm ModProbe ke Kernel # modprobe dm-multipath Startup Config # chkconfig multipathd on # service multipathd start Inisialisasi Multipathing untuk Pertama Kali # dmsetup ls --target=multipath 360060e80042ab00000002ab00000010b (253, 0) Cek Multipathingnya # multipath -ll 360060e80042ab00000002ab00000010b [size=50 GB][features=”0″][hwhandler=”0″] \_ round-robin 0 [prio=1][active] \_ 1:0:0:0 sdb 8:16 [active][ready] \_ round-robin 0 [prio=1][enabled] \_ 2:0:0:0 sdc 8:32 [active][ready] Verifikasi # scsi_id -g -s /block/sdb 360060e80042ab00000002ab00000010b # scsi_id -g -s /block/sdc 360060e80042ab00000002ab00000010b '''!!!Внимание''' для последних версий изменился синтаксис команды scsi_id, теперь нужно писать # scsi_id -g -d /dev/sdb и # scsi_id -g -d /dev/sdс Edit Konfigurasi, Untuk menambahkan device yang akan di”black list” dari multipathing, penggunaan “Friendly Name”, di Multipathnya # vi /etc/multipath.conf ————-add config—————– # Blacklist all devices by default. Remove this to enable multipathing # on the default devices. devnode_blacklist { devnode cciss devnode fd devnode hd devnode md devnode sr devnode scd devnode st devnode ram devnode raw devnode loop devnode sda # internal disk saya } ## Use user friendly names, instead of using WWIDs as names. defaults { user_friendly_names yes path_grouping_policy multibus failback immediate } —————end config—————– Simpan Konfigurasinya # multipath -F Cek Disknya # multipath -v2 create: mpath0 (360060e80042ab00000002ab00000010b) [size=50 GB][features=”0″][hwhandler=”0″] \_ round-robin 0 [prio=1] \_ 1:0:0:0 sdb 8:16 [active][ready] \_ round-robin 0 [prio=1] \_ 2:0:0:0 sdc 8:32 [active][ready] Cek “friendly namesnya” sudah jalan Pa belum # multipath -ll mpath0 (360060e80042ab00000002ab00000010b) [size=50 GB][features=”0″][hwhandler=”0″] \_ round-robin 0 [prio=1][active] \_ 1:0:0:0 sdb 8:16 [active][ready] \_ round-robin 0 [prio=1][enabled] \_ 2:0:0:0 sdc 8:32 [active][ready] Tambahkan Nama devices ke database Multipath # multipath -v3|egrep "vendor|product" vendor = HITACHI product = OPEN-V vendor = HITACHI product = OPEN-V # vi /etc/multipath.conf ——–add config——— devices { device { vendor “HITACHI” product “OPEN-V.” getuid_callout “/sbin/scsi_id -g -u -p0×80 -s /block/%n” } } ———end config——– # multipath -F # multipath -ll mpath0 (SHITACHI_OPEN-V_________10928_) [size=50 GB][features=”0″][hwhandler=”0″] \_ round-robin 0 [prio=1][active] \_ 1:0:0:0 sdb 8:16 [active][ready] \_ round-robin 0 [prio=1][enabled] \_ 2:0:0:0 sdc 8:32 [active][ready] Bikin Mount Point Baru # fdisk -l /dev/mapper/mpath0 Disk /dev/mapper/mpath0: 53.6 GB, 53688664064 bytes 64 heads, 32 sectors/track, 51201 cylinders Units = cylinders of 2048 * 512 = 1048576 bytes # pvcreate /dev/mapper/mpath0 Physical volume “/dev/mapper/mpath0″ successfully created # vgcreate vg00 /dev/mapper/mpath0 Volume group “vg00″ successfully created # lvcreate -L 25G -n lvol1 vg00 Logical volume “lvol1″ created # mkfs.ext3 /dev/vg00/lvol1 # mkdir /archive # mount /dev/vg00/lvol1 /archive # vi /etc/fstab ——–add config——— /dev/mapper/vg00-lvol1 /archive ext3 defaults 1 2 ——–end config——— # df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 20G 9.2G 9.2G 50% / /dev/sda1 190M 18M 163M 10% /boot none 2.0G 0 2.0G 0% /dev/shm /dev/sda6 15G 4.7G 9.0G 35% /home /dev/sda7 9.7G 56M 9.1G 1% /opt /dev/sda8 3.9G 59M 3.6G 2% /tmp /dev/sda5 15G 7.2G 6.6G 53% /var /dev/mapper/vg00-lvol1 25G 77M 24G 1% /archive Extend MountPoint Barunya # lvdisplay /dev/vg00/lvol1 — Logical volume — LV Name /dev/vg00/lvol1 VG Name vg00 LV UUID uRNOWC-2OQ8-SNSD-BgB1-3i1y-eYVe-21Y11n LV Write Access read/write LV Status available # open 1 LV Size 35.00 GB Current LE 8960 Segments 1 Allocation inherit Read ahead sectors 0 Block device 253:1 # lvextend -L +10G /dev/vg00/lvol1 Extending logical volume lvol1 to 35.00 GB Logical volume lvol1 successfully resized # ext2online /archive ext2online v1.1.18 - 2001/03/18 for EXT2FS 0.5b # df -h Filesystem Size Used Avail Use% Mounted on /dev/sda3 20G 9.2G 9.2G 50% / /dev/sda1 190M 18M 163M 10% /boot none 2.0G 0 2.0G 0% /dev/shm /dev/sda6 15G 4.7G 9.0G 35% /home /dev/sda7 9.7G 56M 9.1G 1% /opt /dev/sda8 3.9G 59M 3.6G 2% /tmp /dev/sda5 15G 7.2G 6.6G 53% /var /dev/mapper/vg00-lvol1 35G 81M 33G 1% /archive Источник: http://xgu.ru/wiki/Multipath |