在Ubuntu上安裝和配置Multipath分為以下幾個步驟:
sudo apt-get update
sudo apt-get install -y multipath-tools open-iscsi
sudo modprobe dm-multipath
sudo modprobe scsi_dh_alua
sudo nano /etc/multipath.conf
將以下內容粘貼到配置文件中,根據實際情況修改設備名稱、WWID和路徑組:
defaults {
user_friendly_names yes
path_grouping_policy "group_by_prio"
}
devices {
device {
vendor "VendorName"
product "ProductName"
path_grouping_policy group_by_prio
prio alua
path_checker tur
failback immediate
rr_weight uniform
no_path_retry queue
}
}
blacklist {
devnode "^sd[a-z]"
}
blacklist_exceptions {
device {
vendor "VendorName"
product "ProductName"
}
}
sudo systemctl restart multipathd
sudo iscsiadm -m discovery -t sendtargets -p<target_ip>
sudo iscsiadm -m node -l
multipath -ll
如果一切正常,您應該能看到類似于以下的輸出:
mpatha (36001405a8f9b9db) dm-0 VendorName, ProductName
size=1.0G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=1 status=active
|- 3:0:0:0 sda 8:0 active ready running
`- 4:0:0:0 sdb 8:16 active ready running
現在,您已經成功地在Ubuntu上安裝并配置了Multipath。請注意,這些步驟可能因存儲設備和網絡配置而有所不同。