您好,登錄后才能下訂單哦!
使用multipath創建asm磁盤
創建asm磁盤的方法格式各樣,本文主要為了標準化,統一采用multipath與udev結合管理asm磁盤.適用于linux6 ,linux7,多路徑或者單一路徑.
以下操作使用oracle linux 7為例.
1.安裝multipath軟件
yum源使用oracle官方源或者本地iso源
[root@oel7 ~]# yum provides multipath
Loaded plugins: ulninfo
device-mapper-multipath-0.4.9-119.el7.x86_64 : Tools to manage multipath devices using device-mapper
Repo : dbinstall
Matched from:
Filename : /usr/sbin/multipath
# yum install device-mapper-multipath-0.4.9-119.el7.x86_64
2.加載模塊&創建配置文件
初次安裝需要加載dm模塊
# modprobe dm-multipath
# modprobe dm-round-robin
# cp /usr/share/doc/device-mapper-multipath-*/multipath.conf /etc/multipath.conf
3.編輯配置文件 /etc/multipath.conf
devices {
device {
vendor "VMware, "
product "VMware Virtual S"
path_grouping_policy multibus
path_checker readsector0
path_selector "round-robin 0"
hardware_handler "0"
failback 15
rr_weight priorities
no_path_retry queue
}
}
multipaths {
multipath {
wwid 36000c29b9e405c3d07021157ace9ab9f
alias asm_data01
}
multipath {
wwid 36000c2933be13ffabcb0ce90806ea5dd
alias asm_fra01
}
}
4.查看multipath設備
重啟服務
# systemctl restart multipathd
# multipath -ll
由于是虛擬機且非多路徑,并沒有生成相關設備.此時我們手動添加wwid到multipath信息庫.若為真實多路徑,無需手動添加
multipath -a /dev/sdb
multipath -a /dev/sdc
再次重啟服務
# systemctl restart multipathd
查看設備
# multipath -ll
asm_fra01 (36000c2933be13ffabcb0ce90806ea5dd) dm-3 VMware, ,VMware Virtual S
size=10G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 0:0:2:0 sdc 8:32 active ready running
asm_data01 (36000c29b9e405c3d07021157ace9ab9f) dm-2 VMware, ,VMware Virtual S
size=30G features='1 queue_if_no_path' hwhandler='0' wp=rw
`-+- policy='round-robin 0' prio=1 status=active
`- 0:0:1:0 sdb 8:16 active ready running
5.配置udev規則
前面做了這么多工作主要為了udev規則配置簡單
來看下multipath管理的設備特點
[root@oel7 ~]# udevadm info -q all -n /dev/mapper/asm_data01
P: /devices/virtual/block/dm-2
N: dm-2
L: 10
S: disk/by-id/dm-name-asm_data01
S: disk/by-id/dm-uuid-mpath-36000c29b9e405c3d07021157ace9ab9f
S: disk/by-label/DATA1
S: mapper/asm_data01
E: DEVLINKS=/dev/disk/by-id/dm-name-asm_data01 /dev/disk/by-id/dm-uuid-mpath-36000c29b9e405c3d07021157ace9ab9f /dev/disk/by-label/DATA1 /dev/mapper/asm_data01
E: DEVNAME=/dev/dm-2
E: DEVPATH=/devices/virtual/block/dm-2
E: DEVTYPE=disk
E: DM_MULTIPATH_TIMESTAMP=1536682254
E: DM_NAME=asm_data01
E: DM_SUSPENDED=0
E: DM_UDEV_DISABLE_LIBRARY_FALLBACK_FLAG=1
E: DM_UDEV_PRIMARY_SOURCE_FLAG=1
E: DM_UDEV_RULES_VSN=2
E: DM_UUID=mpath-36000c29b9e405c3d07021157ace9ab9f
E: ID_FS_LABEL=DATA1
E: ID_FS_LABEL_ENC=DATA1
E: ID_FS_TYPE=oracleasm
E: ID_FS_USAGE=filesystem
E: MAJOR=249
E: MINOR=2
E: MPATH_SBIN_PATH=/sbin
E: SUBSYSTEM=block
E: TAGS=:systemd:
E: USEC_INITIALIZED=83840
利用著色部分做udev規則
cat >> /etc/udev/rules.d/99-oracle-asmdevices.rules <<END
KERNEL=="dm-*",ENV{DM_UUID}=="mpath-?*",ENV{DM_NAME}=="asm_?*",OWNER="grid",GROUP="asmadmin",MODE="0660"
END
啟動udev
# udevadm trigger -c change
linux6用start_udev
查看權限
[root@oel7 ~]# ll /dev/dm*
brw-rw----. 1 root disk 249, 0 Sep 12 00:33 /dev/dm-0
brw-rw----. 1 root disk 249, 1 Sep 12 00:33 /dev/dm-1
brw-rw----. 1 grid asmadmin 249, 2 Sep 12 00:33 /dev/dm-2
brw-rw----. 1 grid asmadmin 249, 3 Sep 12 00:33 /dev/dm-3
至此asm磁盤就創建成功了.
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。