Linux MultiPath多重路徑軟體實施說明
Multipath的工作原理
當multipath啟動的時候,它通過系統命令scsi_id -eg -s /block/sdX得到proc/partitions 裡面所有塊裝置的 UUID(universally unique identify),然後把所有具有同一個UUID的塊裝置群組成一個Group,在/dev/mapper 生產一個對應的單獨的裝置。當裝置產生後就可以使用fdisk或者parted進行分區,分區可以使用kpartx命令進行註冊,然後就可以是用系統命令進行建立檔案系統和mount 。
一般在系列安裝過程中都會同時安裝device-mapper軟體包,使用linux內建命令rpm查詢一下是否已經安裝次軟體包。使用命令 rpm –ivh 進行安裝,安裝以下rpm包:
device-mapper-*
device-mapper-multipath-*
device-mapper-1*
啟動多重路徑及配置多重路徑
啟動多重路徑,通過mpathconf命令建立預設範本。建立預設配置,啟動和啟用multipathd進程,可以使用以下命令:
mpathconf --enable --with_multipathd y
配置完成後建議重新啟動多重路徑軟體:
/etc/init.d/multipathd restart
備忘:啟動完成後會在/etc/下產生multipath.conf 檔案以及在/etc/multipath下產生bindings 及wwid,其中wwid記錄了系統中所有掛載盤的盤唯一ID,Bindings記錄了ID對應的映射盤一般綁定完後會在/dev/mapper下產生類似於mpathx等檔案
備忘------------------------------------------------------
如果沒有沒有產生可以按照Deploying Oracle RAC 11g R2 Database on Red Hat EnterpriseLinux 6
的如下方式來進行操作:
1. As the root user, install the device-mapper-multipath package using the yum package
manager.
# yum install device-mapper-multipath
2. Copy the multipath.conf file found within /usr/share/doc/device-mapper-multipath-0.4.9/
to /etc/
# cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/
3. Capture the scsi id of the local disk(s) on the system.
# scsi_id --whitelisted --replace-whitespace –-device=/dev/sda
3600508b1001030353434363646301200
4. Uncomment and modify the blacklist section within the /etc/multipath.conf file to include
the scsi id of the local disk on the system. Once complete, save the changes made to
the multipath.conf file.
blacklist {
wwid 3600508b1001030353434363646301200
devnode "^(ram|raw|loop|fd|md|dm-|sr|scd|st)[0-9]*"
devnode "^hd[a-z]"
}
5. Start the multipath daemon.
# service multipathd start
Starting multipathd daemon: [ OK ]
6. Enable the multipath daemon to ensure it is started upon boot time.
# chkconfig multipathd on
7. Identify the dm- device, size, and WWID of each device mapper volume for Oracle
OCR and voting disks, data disks and recovery disks. In this example, volume mpathb
is identified via the following command:
# multipath -ll