溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

使用multipath創(chuàng)建asm磁盤

發(fā)布時(shí)間:2020-08-11 07:42:13 來源:ITPUB博客 閱讀:178 作者:icclu 欄目:關(guān)系型數(shù)據(jù)庫

使用multipath創(chuàng)建asm磁盤

創(chuàng)建asm磁盤的方法格式各樣,本文主要為了標(biāo)準(zhǔn)化,統(tǒng)一采用multipath與udev結(jié)合管理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.加載模塊&創(chuàng)建配置文件

初次安裝需要加載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設(shè)備

重啟服務(wù)

# systemctl restart multipathd

# multipath -ll

由于是虛擬機(jī)且非多路徑,并沒有生成相關(guān)設(shè)備.此時(shí)我們手動(dòng)添加wwid到multipath信息庫.若為真實(shí)多路徑,無需手動(dòng)添加

multipath -a /dev/sdb

multipath -a /dev/sdc

再次重啟服務(wù)

# systemctl restart multipathd

查看設(shè)備

# 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規(guī)則

前面做了這么多工作主要為了udev規(guī)則配置簡(jiǎn)單

來看下multipath管理的設(shè)備特點(diǎn)

[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規(guī)則

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

啟動(dòng)udev

# udevadm trigger -c change

linux6用start_udev

查看權(quán)限

[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磁盤就創(chuàng)建成功了.


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI