温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

RedHat 5.4上iscsi+multipath多路径存储怎么配置获取设备的wwid

发布时间:2021-11-08 10:10:39 来源:亿速云 阅读:214 作者:柒染 栏目:建站服务器

这篇文章给大家介绍RedHat 5.4上iscsi+multipath多路径存储怎么配置获取设备的wwid,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

   最近在RedHat上搭建Oracle 11g r2 RAC,其中存储管理是采用iscsi+multipath的方式,所以将这部分的管理配置单独拿出

一:安装iscsi包

     安装scsi initiator包。安装包可从安装光盘中找到

     [root@rac122 ~]# rpm -qa | grep iscsi
     iscsi-initiator-utils-6.2.0.871-0.10.el5

二:启用iscsi设备

      新建接口文件,接口文件保存在/var/lib/iscsi/ifaces目录下:

      [root@rac122 ~]# ls /var/lib/iscsi/ifaces
      bnx2i.00:00:00:00:00:00

      [root@rac122 ~]# iscsiadm -m iface -I eth0 -o new
      New interface eth0 added
      [root@rac122 ~]# ls /var/lib/iscsi/ifaces
      bnx2i.00:00:00:00:00:00  eth0
      [root@rac122 ~]# cat /var/lib/iscsi/ifaces/eth0
      # BEGIN RECORD 2.0-871
      iface.iscsi_ifacename = eth0
      iface.transport_name = tcp
      # END RECORD
      [root@rac122 ~]# iscsiadm -m iface -I eth0 --op=update -n iface.net_ifacename -v eth0
      eth0 updated.
      [root@rac122 ~]# cat /var/lib/iscsi/ifaces/eth0
      # BEGIN RECORD 2.0-871
      iface.iscsi_ifacename = eth0
      iface.net_ifacename = eth0
      iface.transport_name = tcp
      # END RECORD

           建完接口文件重启iscsi服务

   [root@rac122 ~]# service iscsi restart
   Stopping iSCSI daemon: 
   iscsid dead but pid file exists
   [  OK  ]off network shutdown. Starting iSCSI daemon: [  OK  ]
   [  OK  ]
   Setting up iSCSI targets: iscsiadm: No records found!
   [  OK  ]

           根据提供的IP收索iscsi target
   [root@rac122 ~]# iscsiadm -m discovery -t st -p 10.1.252.148:3260
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-dcced9007-10d000000c74cc10-vol-rac7
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-495ed9007-b68000000ca4cc4d-vol-rac8
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-fdded9007-b80000000c44cb23-vol-rac6
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-fc7ed9007-6b1000000c14cb23-vol-rac5
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-668ed9007-1ca000000a34ca57-vol-rac2
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-631ed9007-a93000000a04ca57-vol-rac1
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-697ed9007-251000000a64ca57-vol-rac3
   10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-6b1ed9007-b7c000000a94ca57-vol-rac4

           与搜素到的target建立连接

    [root@rac122 ~]# iscsiadm -m node -l
    Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-dcced9007-10d000000c74cc10-vol-rac7, portal: 10.1.252.148,3260]
    Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-495ed9007-b68000000ca4cc4d-vol-rac8, portal: 10.1.252.148,3260]
    Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-fdded9007-b80000000c44cb23-vol-rac6, portal: 10.1.252.148,3260]
    Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-fc7ed9007-6b1000000c14cb23-vol-rac5, portal: 10.1.252.148,3260]
    Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-668ed9007-1ca000000a34ca57-vol-rac2, portal: 10.1.252.148,3260]
    Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-631ed9007-a93000000a04ca57-vol-rac1, portal: 10.1.252.148,3260]
            Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-697ed9007-251000000a64ca57-vol-rac3, portal: 10.1.252.148,3260]
    Logging in to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-6b1ed9007-b7c000000a94ca57-vol-rac4, portal: 10.1.252.148,3260]
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-dcced9007-10d000000c74cc10-vol-rac7, portal: 10.1.252.148,3260]: successful
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-495ed9007-b68000000ca4cc4d-vol-rac8, portal: 10.1.252.148,3260]: successful
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-fdded9007-b80000000c44cb23-vol-rac6, portal: 10.1.252.148,3260]: successful
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-fc7ed9007-6b1000000c14cb23-vol-rac5, portal: 10.1.252.148,3260]: successful
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-668ed9007-1ca000000a34ca57-vol-rac2, portal: 10.1.252.148,3260]: successful
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-631ed9007-a93000000a04ca57-vol-rac1, portal: 10.1.252.148,3260]: successful
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-697ed9007-251000000a64ca57-vol-rac3, portal: 10.1.252.148,3260]: successful
    Login to [iface: eth0, target: iqn.2001-05.com.equallogic:0-8a0906-6b1ed9007-b7c000000a94ca57-vol-rac4, portal: 10.1.252.148,3260]: successful

            [root@rac122 ~]# iscsiadm -m session
            tcp: [1] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-dcced9007-10d000000c74cc10-vol-rac7
            tcp: [2] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-495ed9007-b68000000ca4cc4d-vol-rac8
            tcp: [3] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-fdded9007-b80000000c44cb23-vol-rac6
            tcp: [4] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-fc7ed9007-6b1000000c14cb23-vol-rac5
            tcp: [5] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-668ed9007-1ca000000a34ca57-vol-rac2
            tcp: [6] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-631ed9007-a93000000a04ca57-vol-rac1
            tcp: [7] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-697ed9007-251000000a64ca57-vol-rac3
            tcp: [8] 10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-6b1ed9007-b7c000000a94ca57-vol-rac4

            [root@rac122 ~]# iscsiadm -m session -P3
            iSCSI Transport Class version 2.0-871
            version 2.0-871
            Target: iqn.2001-05.com.equallogic:0-8a0906-dcced9007-10d000000c74cc10-vol-rac7
                    Current Portal: 10.1.252.149:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 1
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 20 State: running
                            scsi20 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sdk          State: running
            Target: iqn.2001-05.com.equallogic:0-8a0906-495ed9007-b68000000ca4cc4d-vol-rac8
                    Current Portal: 10.1.252.150:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 2
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 21 State: running
                            scsi21 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sdd          State: running
            Target: iqn.2001-05.com.equallogic:0-8a0906-fdded9007-b80000000c44cb23-vol-rac6
                    Current Portal: 10.1.252.149:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 3
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 22 State: running
                            scsi22 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sde          State: running
            Target: iqn.2001-05.com.equallogic:0-8a0906-fc7ed9007-6b1000000c14cb23-vol-rac5
                    Current Portal: 10.1.252.150:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 4
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 23 State: running
                            scsi23 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sdf          State: running
            Target: iqn.2001-05.com.equallogic:0-8a0906-668ed9007-1ca000000a34ca57-vol-rac2
                    Current Portal: 10.1.252.149:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 5
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 24 State: running
                            scsi24 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sdh          State: running
            Target: iqn.2001-05.com.equallogic:0-8a0906-631ed9007-a93000000a04ca57-vol-rac1
                    Current Portal: 10.1.252.149:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 6
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 25 State: running
                            scsi25 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sdg          State: running
            Target: iqn.2001-05.com.equallogic:0-8a0906-697ed9007-251000000a64ca57-vol-rac3
                    Current Portal: 10.1.252.150:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 7
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 26 State: running
                            scsi26 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sdi          State: running
            Target: iqn.2001-05.com.equallogic:0-8a0906-6b1ed9007-b7c000000a94ca57-vol-rac4
                    Current Portal: 10.1.252.150:3260,1
                    Persistent Portal: 10.1.252.148:3260,1
                            **********
                            Interface:
                            **********
                            Iface Name: eth0
                            Iface Transport: tcp
                            Iface Initiatorname: iqn.1994-05.com.redhat:b9e5bb909ae1
                            Iface IPaddress: 10.1.252.122
                            Iface HWaddress:
                            Iface Netdev: eth0
                            SID: 8
                            iSCSI Connection State: LOGGED IN
                            iSCSI Session State: LOGGED_IN
                            Internal iscsid Session State: NO CHANGE
                            ************************
                            Negotiated iSCSI params:
                            ************************
                            HeaderDigest: None
                            DataDigest: None
                            MaxRecvDataSegmentLength: 262144
                            MaxXmitDataSegmentLength: 65536
                            FirstBurstLength: 65536
                            MaxBurstLength: 262144
                            ImmediateData: Yes
                            InitialR2T: No
                            MaxOutstandingR2T: 1
                            ************************
                            Attached SCSI devices:
                            ************************
                            Host Number: 27 State: running
                            scsi27 Channel 00 Id 0 Lun: 0
                                    Attached scsi disk sdj          State: running

            查看连接状态

            [root@rac122 ~]# netstat -anp | grep 3260
            tcp        0      0 10.1.252.122:48858          10.1.252.150:3260           ESTABLISHED 19427/iscsid        
            tcp        0      0 10.1.252.122:48856          10.1.252.150:3260           ESTABLISHED 19427/iscsid        
            tcp        0      0 10.1.252.122:48862          10.1.252.150:3260           ESTABLISHED 19427/iscsid        
            tcp        0      0 10.1.252.122:48861          10.1.252.150:3260           ESTABLISHED 19427/iscsid        
            tcp        0      0 10.1.252.122:63216          10.1.252.149:3260           ESTABLISHED 19427/iscsid        
            tcp        0      0 10.1.252.122:63218          10.1.252.149:3260           ESTABLISHED 19427/iscsid        
            tcp        0      0 10.1.252.122:63221          10.1.252.149:3260           ESTABLISHED 19427/iscsid        
            tcp        0      0 10.1.252.122:63220          10.1.252.149:3260           ESTABLISHED 19427/iscsid
 

            [root@rac122 ~]# iscsiadm -m node
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-dcced9007-10d000000c74cc10-vol-rac7
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-495ed9007-b68000000ca4cc4d-vol-rac8
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-fdded9007-b80000000c44cb23-vol-rac6
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-fc7ed9007-6b1000000c14cb23-vol-rac5
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-668ed9007-1ca000000a34ca57-vol-rac2
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-631ed9007-a93000000a04ca57-vol-rac1
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-697ed9007-251000000a64ca57-vol-rac3
            10.1.252.148:3260,1 iqn.2001-05.com.equallogic:0-8a0906-6b1ed9007-b7c000000a94ca57-vol-rac

三:安装Mutipath包

            安装scsi initiator包。安装包可从安装光盘中找到

            [root@rac122 ~]# rpm -qa | grep device-mapper
                    device-mapper-multipath-0.4.7-30.el5
                    device-mapper-1.02.32-1.el5
                    device-mapper-1.02.32-1.el5
                    device-mapper-event-1.02.32-1.el5

四:配置Multipath参数

       4.1、定位配置文件并备份再作修改

        Multipath的参数配置文件是:/etc/multipath.conf  ,刚安装完Multipath包该文件里面的绝大多数内容都是注释的。将该文件复制一份留作备用,

                 然后再修改另一份文件。

                [root@rac122 ~]# cp /etc/multipath.conf /etc/multipath.conf.back

                   [root@rac122 ~]# ls /etc/ | grep multipath
                   multipath.conf
                           multipath.conf.bak

       4.2、黑名单过滤

                Multipath默认会把所有设置都加入到黑名(Blacklist)单中,也就是禁止使用所有设备,所以取消默认设置,将文件对应blacklist块的内容更新为如下:

                # Blacklist all devices by default. Remove this to enable multipathing
          # on the default devices.
          blacklist {
                 devnode "^sd[a]$"
           }

        4.3、获取wwwid,

               在修改配置文件中的multipath {
                wwid                    36090a07800d98e6657ca340a0000a01c
                alias                   vol-aidev01
                path_grouping_policy    multibus
                path_checker            readsector0
                path_selector           "round-robin 0"
                failback                manual
                rr_weight               priorities
              no_path_retry           5
        }块时,会用到wwwid,所以要先将各设备的wwwid,

                
查看刚才启用了哪些iscsi设备

                [root@rac122 userfile]# fdisk -l
                Disk /dev/sda: 299.4 GB, 299439751168 bytes
                255 heads, 63 sectors/track, 36404 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes


                   Device Boot      Start         End      Blocks   Id  System
                                /dev/sda1   *           1          13      104391   83  Linux
                /dev/sda2              14       36404   292310707+  8e  Linux LVM


                Disk /dev/sdd: 536.8 GB, 536881397760 bytes
                255 heads, 63 sectors/track, 65272 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes


                   Device Boot      Start         End      Blocks   Id  System


                Disk /dev/sde: 17.1 GB, 17191403520 bytes
                64 heads, 32 sectors/track, 16395 cylinders
                Units = cylinders of 2048 * 512 = 1048576 bytes


                   Device Boot      Start         End      Blocks   Id  System


                Disk /dev/sdf: 17.1 GB, 17191403520 bytes
                64 heads, 32 sectors/track, 16395 cylinders
                Units = cylinders of 2048 * 512 = 1048576 bytes


                   Device Boot      Start         End      Blocks   Id  System


                Disk /dev/sdg: 8603 MB, 8603566080 bytes
                64 heads, 32 sectors/track, 8205 cylinders
                Units = cylinders of 2048 * 512 = 1048576 bytes


                   Device Boot      Start         End      Blocks   Id  System


                Disk /dev/sdh: 8603 MB, 8603566080 bytes
                64 heads, 32 sectors/track, 8205 cylinders
                Units = cylinders of 2048 * 512 = 1048576 bytes


                Disk /dev/sdh doesn't contain a valid partition table


                Disk /dev/sdi: 8603 MB, 8603566080 bytes
                64 heads, 32 sectors/track, 8205 cylinders
                Units = cylinders of 2048 * 512 = 1048576 bytes


                   Device Boot      Start         End      Blocks   Id  System


                Disk /dev/sdj: 8603 MB, 8603566080 bytes
                64 heads, 32 sectors/track, 8205 cylinders
                Units = cylinders of 2048 * 512 = 1048576 bytes


                   Device Boot      Start         End      Blocks   Id  System


                Disk /dev/sdk: 107.3 GB, 107379425280 bytes
                255 heads, 63 sectors/track, 13054 cylinders
                Units = cylinders of 16065 * 512 = 8225280 bytes


                   Device Boot      Start         End      Blocks   Id  System

               可以看到启用了sdd、sde、sdf、sdg、sdh、sdi、sdj、sdk八个iscsi设备

分别获取这八个设备的wwwid

[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sdd    
36090a07800d95e494dcca40c000080b6
[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sde       
36090a07800d9defd23cb440c000000b8
[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sdf    
36090a07800d97efc23cb140c000010
[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sdg  
36090a07800d91e6357ca040a000030a9
[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sdh
36090a07800d98e6657ca340a0000a01c
[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sdi
36090a07800d97e6957ca640a00001025
[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sdj
36090a07800d91e6b57ca940a0000c0b7
[root@rac122 userfile]# /sbin/scsi_id -g -u -s /block/sdk
36090a07800d9cedc10cc740c0000d010                     

在获取好各设备的wwwid后,在配置文件/etc/multipath.conf中添加如下内容

                multipaths {
                        multipath {
                                wwid                    36090a07800d98e6657ca340a0000a01c
                                alias                   vol-aidev01
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                        multipath {
                                wwid                    36090a07800d97efc23cb140c0000106b
                                alias                   vol-aidev02
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                        multipath {
                                wwid                    36090a07800d91e6b57ca940a0000c0b7
                                alias                   vol-aidev03
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                        multipath {
                                wwid                    36090a07800d91e6357ca040a000030a9
                                alias                   vol-aidev04
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                        multipath {
                                wwid                    36090a07800d95e494dcca40c000080b6
                                alias                   vol-aidev05
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                        multipath {
                                wwid                    36090a07800d9defd23cb440c000000b8
                                alias                   vol-aidev06
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                        multipath {
                                wwid                    36090a07800d9cedc10cc740c0000d010
                                alias                   vol-aidev07
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                        multipath {
                                wwid                    36090a07800d97e6957ca640a00001025
                                alias                   vol-aidev08
                                path_grouping_policy    multibus
                                path_checker            readsector0
                                path_selector           "round-robin 0"
                                failback                manual
                                rr_weight               priorities
                                no_path_retry           5
                        }
                }

                devices {
                       device {
                               vendor                  "COMPAQ  "
                               product                 "HSV110 (C)COMPAQ"
                               path_grouping_policy    multibus
                               getuid_callout          "/sbin/scsi_id -g -u -s /block/%n"
                               path_checker            readsector0
                               path_selector           "round-robin 0"
                               hardware_handler        "0"
                               failback                15
                               rr_weight               priorities
                               no_path_retry           queue
                       }
                }

五、重启Multipath服务,验证配置

       重启服务

            [root@rac122 userfile]# service multipathd restart
            Stopping multipathd daemon: [  OK  ]
            Starting multipathd daemon: [  OK  ]

       
      显示映射
            [root@rac122 userfile]# ls -lrt /dev/mapper/*
            crw------- 1 root root  10, 63 May 28 10:32 /dev/mapper/control
            brw------- 1 root root 253,  6 May 28 10:32 /dev/mapper/VG00-LV_SP01
            brw------- 1 root root 253,  0 May 28 10:32 /dev/mapper/VG00-LV01
            brw------- 1 root root 253,  1 May 28 10:32 /dev/mapper/VG00-LV_DATA01
            brw------- 1 root root 253,  2 May 28 10:32 /dev/mapper/VG00-LV_TMP01
            brw------- 1 root root 253,  3 May 28 10:32 /dev/mapper/VG00-LV_ORADATA01
            brw------- 1 root root 253,  4 May 28 10:32 /dev/mapper/VG00-LV_VAR01
            brw------- 1 root root 253,  5 May 28 10:32 /dev/mapper/VG00-LV_SW01
            brw-rw---- 1 root disk 253, 12 Jun  6 22:08 /dev/mapper/vol-aidev08
            brw-rw---- 1 root disk 253,  8 Jun  6 22:08 /dev/mapper/vol-aidev06
            brw-rw---- 1 root disk 253,  7 Jun  6 22:08 /dev/mapper/vol-aidev05
            brw-rw---- 1 root disk 253, 10 Jun  6 22:08 /dev/mapper/vol-aidev04
            brw-rw---- 1 root disk 253,  9 Jun  6 22:08 /dev/mapper/vol-aidev02
            brw-rw---- 1 root disk 253, 11 Jun  6 22:08 /dev/mapper/vol-aidev01
            brw-rw---- 1 root disk 253, 14 Jun  6 22:08 /dev/mapper/vol-aidev07
            brw-rw---- 1 root disk 253, 13 Jun  6 22:08 /dev/mapper/vol-aidev03

            multipath命令能够查看到活跃的路径
            [root@rac122 userfile]# multipath -ll
            vol-aidev08 (36090a07800d97e6957ca640a00001025) dm-12 EQLOGIC,100E-00
            [size=8.0G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 26:0:0:0 sdi 8:128 [active][ready]
            vol-aidev07 (36090a07800d9cedc10cc740c0000d010) dm-14 EQLOGIC,100E-00
            [size=100G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 20:0:0:0 sdk 8:160 [active][ready]
            vol-aidev06 (36090a07800d9defd23cb440c000000b8) dm-8 EQLOGIC,100E-00
            [size=16G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 22:0:0:0 sde 8:64  [active][ready]
            vol-aidev05 (36090a07800d95e494dcca40c000080b6) dm-7 EQLOGIC,100E-00
            [size=500G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 21:0:0:0 sdd 8:48  [active][ready]
            vol-aidev04 (36090a07800d91e6357ca040a000030a9) dm-10 EQLOGIC,100E-00
            [size=8.0G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 25:0:0:0 sdg 8:96  [active][ready]
            vol-aidev03 (36090a07800d91e6b57ca940a0000c0b7) dm-13 EQLOGIC,100E-00
            [size=8.0G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 27:0:0:0 sdj 8:144 [active][ready]
            vol-aidev02 (36090a07800d97efc23cb140c0000106b) dm-9 EQLOGIC,100E-00
            [size=16G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 23:0:0:0 sdf 8:80  [active][ready]
            vol-aidev01 (36090a07800d98e6657ca340a0000a01c) dm-11 EQLOGIC,100E-00
            [size=8.0G][features=1 queue_if_no_path][hwhandler=0][rw]
            \_ round-robin 0 [prio=1][active]
             \_ 24:0:0:0 sdh 8:112 [active][ready]
          

            将multipath服务设置成开机自启动

            [root@rac121 ~]# chkconfig multipathd  on 

关于RedHat 5.4上iscsi+multipath多路径存储怎么配置获取设备的wwid就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI