Multipath是多路徑聚合軟件,用於解決SAN環境下,多條I/O路徑的流量分配、路徑管理。對於OS而言,每條路徑都是一塊物理盤,在沒有多路徑聚合軟件的情況下,會出現實際上單一盤由於多鏈路導致系統認到多塊盤的情況。多路徑軟件常用於故障切換和鏈路冗餘和I\O流量的負載均衡 Multipath的應用操作:1、查看服務進程multipathd。
[[email protected] ~]# ps -ef |
grep multipathd |
[[email protected] ~]# service multipathd start |
[[email protected] ~]#/etc/init.d/multipathd start |
[[email protected] ~]# cat /var/lib/multipath/bindings # Multipath bindings, Version : 1.0 # NOTE: this file is automatically maintained by the multipath program. # You should not need to edit this file in normal circumstances. ## Format: #mpath0 36005076b08164f4077654321a3efb95fe mpath1 3600508a4010c3a920000c00002370000 |
*注意,表中的英文提示,文件內容由multipath自動生成,一般情況下,不需要自動更改。 3、編輯multipath配置文件/etc/multipath.conf
cp /usr/share/doc/packages/multipath-tools/multipath.conf.synthetic /etc/multipath.conf
[[email protected] ~]# cat /etc/multipath.conf ********************ignore**************************** ## Use user friendly names, instead of using WWIDs as names. defaults { user_friendly_names yes }# Blacklist all devices by default. Remove this to
enable multipathing devnode_blacklist { multipaths { } ********************ignore**************************** |
2、本例中,將wwid 3600508a4010c3a920000c00002370000的磁盤,綁定別名 example,默認情況下Use user friendly names沒有被解注,multipath生成dm設備之後,會同時在/dev/mapper/下生成以磁盤wwid爲名的符號鏈接指向對應的dm設備,但此例中,Use user friendly names已解注,/dev/mapper/中會顯示名爲example的設備。
4、每次編輯修改multipath.conf文件之後都應該重啓multipath服務
[[email protected] ~]# service multipathd restart |
[[email protected] ~]multipath -F [[email protected] ~]#multipath -v2 |
[[email protected] ~]# cat /proc/partitions ****************ignore******************************253 0 94371840 dm-0 253 1 94371840 dm-1 253 2 94371840 dm-2 ****************ignore****************************** |
[[email protected] ~]# multipath -ll Mpath1 (3600508a4010c3a920000c00002370000) [size=40 GB][features="1 queue_if_no_path"][hwhandler="0"] \_ round-robin 0 [prio=200][active] \_ 4:0:4:27 sdbs 68:96 [active][ready] \_ 4:0:6:27 sdey 129:160 [active][ready] \_ 5:0:4:27 sdka 65:480 [active][ready] \_ 5:0:6:27 sdng 71:288 [active][ready]\_ round-robin 0 [prio=40][enabled] \_ 4:0:5:27 sddi 71:0 [active][ready] \_ 4:0:7:27 sdgo 132:64 [active][ready] \_ 5:0:5:27 sdlq 68:384 [active][ready] \_ 5:0:7:27 sdow 129:448 [active][ready] |
[[email protected] ~]# cat /proc/scsi/lpfc/4 lpfc0t00 DID 050600 WWPN 50:00:1f:e1:50:14:f0:f8 WWNN 50:00:1f:e1:50:14:f0:f0 lpfc0t01 DID 050400 WWPN 50:00:1f:e1:50:14:f0:fc WWNN 50:00:1f:e1:50:14:f0:f0 |