最近,指導一位同僚對oracle rac叢集伺服器的linux系統做多路徑映射和udev綁盤,然後做ASM加盤,一共做了兩次;
第一次,同僚在生産端加盤,rac叢集兩台伺服器識别到的盤符是sdw、sdx、sdy、sdz之類,經過多路徑綁定映射和udev
修改權限,ASM加盤很順利,但是,由于第一次指導過同僚,第二次同僚按照第一次操作進行多路徑映射時,無論怎麼操作
多路徑隻識别到一塊盤,multipah配置重新添加、主機伺服器重新開機,這些操作之後,多路徑還是隻識别到一個盤。同僚十分
不解,咨詢我查找原因。
經過反複檢視同僚的多路徑映射配置檔案,不經意間發現多路徑配置的“正規表達式”:
# cat /etc/multipath.conf
blacklist {
wwid 3600508b1001c0ee72b8dab703df2fdfd
devnode "^sda"
}
defaults {
polling_interval 10
user_friendly_names no
find_multipaths yes
}
/etc/multipath.conf配置檔案中紅色标注字型就是正規表達式的一種,在多路徑配置檔案中是黑名單,作用是對符合正則
表達式的盤不進行多路徑映射,是為了保護作業系統盤。而有時候,作業系統添加的磁盤,盤符可能是複核sda*,就可能被屏
蔽掉,無法進行正常的多路徑映射。
順着被屏蔽的黑名單正規表達式,檢視同僚新加的磁盤,發現命中黑名單的正規表達式:
Disk /dev/sdaw: 171.8 GB, 171798691840 bytes, 335544320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 16384 bytes / 16777216 bytes
Disk /dev/sdaq: 171.8 GB, 171798691840 bytes, 335544320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 16384 bytes / 16777216 bytes
Disk /dev/sdak: 171.8 GB, 171798691840 bytes, 335544320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 16384 bytes / 16777216 bytes
Disk /dev/sdae: 171.8 GB, 171798691840 bytes, 335544320 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 16384 bytes / 16777216 bytes
發現問題原因後,經溝通,同僚注釋掉黑名單正規表達式,将系統盤UUID号加入黑名單:
# cat /etc/multipath.conf
blacklist {
wwid 3600508b1001c0ee72b8dab703df2fdfd
# devnode "^sda"
}
defaults {
polling_interval 10
user_friendly_names no
find_multipaths yes
}
修改多路徑配置,重新開機多路徑服務後,多路徑綁盤成功:
# systemctl reload multipathd.service
# systemctl restart multipathd.service
# multipath -ll
DB_DATA02 (360002ac0000000000000003900021126) dm-14 3PARdata,VV
size=160G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='round-robin 0' prio=50 status=active
|- 14:0:2:5 sdak 65:32 active ready running
|- 16:0:2:5 sdaq 66:160 active ready running
|- 14:0:3:5 sdae 65:192 active ready running
`- 16:0:3:5 sdaw 67:0 active ready running