RedHat 5.4上iscsi+multipath多路徑儲存配置獲取裝置的wwid

luashin發表於2016-04-10

   最近在RedHat上搭建Oracle 11g r2 RAC,其中儲存管理是採用iscsi+multipath的方式,所以將這部分的管理配置單獨拿出來另寫一篇,僅供參考。

概要
一:安裝iscsi包。
二:啟用iscsi裝置。
:安裝Multipath包。
:配置Multipath引數。
五:重啟multipathd 服務,驗證配置

正文

一:安裝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
                   

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9034054/viewspace-2078625/,如需轉載,請註明出處,否則將追究法律責任。

相關文章