服務項目:網站建設、仿站、程序開發、APP開發設計、移動網站開發設計、企業網站設計、電子商務網站開發、網站維護、網站推廣、UX/UI 、HTML5、CSS3、JS / Jquery ...
          四川浚浚科技有限公司
          四川浚浚科技有限公司 (開發設計官網)TEL : 15308000360 / QQ : 38585404

          您的位置:首頁 > 技術經驗 > 服務器 > 正文

          centos 6.8 linux iscsi服務器配置和客戶端連接iscsi
          技術支持服務電話:15308000360 【7x24提供運維服務,解決各類系統/軟硬件疑難技術問題】

          一、服務端配置

          1、首先安裝各種包
          yum search scsi
           
          iscsi-initiator-utils.x86_64 : iSCSI daemon and utility programs
          iscsi-initiator-utils-devel.x86_64 : Development files for iscsi-initiator-utils
          lsscsi.x86_64 : List SCSI devices (or hosts) and associated information
          scsi-target-utils.x86_64 : The SCSI target daemon and utility programs
          libhbalinux.i686 : FC-HBAAPI implementation using scsi_transport_fc interfaces
          libhbalinux.x86_64 : FC-HBAAPI implementation using scsi_transport_fc interfaces
          mtx.x86_64 : SCSI media changer control program
          python-rtslib.noarch : API for RisingTide Systems generic SCSI target
          sdparm.x86_64 : List or change SCSI/SATA disk parameters
          sg3_utils.x86_64 : Utilities for devices that use SCSI command sets
           
           
          執行 yum install -y scsi-target-utils.x86_64 iscsi-initiator-utils.x86_64 iscsi-initiator-utils-devel.x86_64
          其實多裝點也沒有壞處
           
          本機分了100G,在裝系統的時候分了20G,剩余80G沒用
          2、建立分區 
          fdisk /dev/sda  
          我這里建個三個    //建分區步驟略過
          分區建立完畢  一定要 執行 partprobe  命令,寫進內核
          [root@storage 1]# fdisk -l
           
          Disk /dev/sda: 107.4 GB, 107374182400 bytes
          255 heads, 63 sectors/track, 13054 cylinders
          Units = cylinders of 16065 * 512 = 8225280 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x000af23c
           
             Device Boot      Start         End      Blocks   Id  System
          /dev/sda1   *           1        2611    20971520   83  Linux
          /dev/sda2            2611        3916    10482726   83  Linux
          /dev/sda3            3917        6528    20980890   83  Linux
          /dev/sda4            6529       13054    52420095   83  Linux
           
          3.配置tgtd
           vi /etc/tgt/targets.conf 
          在末尾加上如下配置
           
           <target iqn.2008-09.com.example:server.target4>
              direct-store /dev/sda2     # Becomes LUN 1
              direct-store /dev/sda3      # Becomes LUN 2
              direct-store /dev/sda4      # Becomes LUN 3
               initiator-address 10.0.1.2     //允許連接的ip地址
               initiator-address 10.0.1.3
              write-cache off
          </target>
          配置完畢,啟動服務
          service tgtd start
          chkconfig tgtd on
          查看target狀態
          [root@storage ~]# tgt-admin --show
          Target 1: iqn.2008-09.com.example:server.target4
              System information:
                  Driver: iscsi
                  State: ready
              I_T nexus information:
                  I_T nexus: 1
                      Initiator: iqn.1994-05.com.redhat:74bc8f791621
                      Connection: 0
                          IP Address: 10.0.1.3
                  I_T nexus: 2
                      Initiator: iqn.1994-05.com.redhat:9695b6e4df6f
                      Connection: 0
                          IP Address: 10.0.1.2
              LUN information:
                  LUN: 0
                      Type: controller
                      SCSI ID: IET     00010000
                      SCSI SN: beaf10
                      Size: 0 MB, Block size: 1
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: null
                      Backing store path: None
                      Backing store flags: 
                  LUN: 1
                      Type: disk
                      SCSI ID: IET     00010001
                      SCSI SN: beaf11
                      Size: 10734 MB, Block size: 512
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: rdwr
                      Backing store path: /dev/sda2
                      Backing store flags: 
                  LUN: 2
                      Type: disk
                      SCSI ID: IET     00010002
                      SCSI SN: beaf12
                      Size: 21484 MB, Block size: 512
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: rdwr
                      Backing store path: /dev/sda3
                      Backing store flags: 
                  LUN: 3
                      Type: disk
                      SCSI ID: IET     00010003
                      SCSI SN: beaf13
                      Size: 53678 MB, Block size: 512
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: rdwr
                      Backing store path: /dev/sda4
                      Backing store flags: 
              Account information:
              ACL information:
                  10.0.1.2
                  10.0.1.3
          二、客戶端配置
          安裝軟件包
          yum install -y iscsi-initiator-utils.x86_64 iscsi-initiator-utils-devel.x86_64
          service iscsid restart
            chkconfig iscsid on
          2.查找發現網絡中的存儲
          [root@webdb1 ~]# iscsiadm -m discovery -t node
          10.0.1.1:3260 via sendtargets
          192.168.1.141:3260 via sendtargets
          192.168.10.100:3260 via sendtargets
          192.168.10.100:3205 via sendtargets
          10.0.1.1:3205 via sendtargets
          3.連接iscsi
           iscsiadm -m node  //發現節點
           
          [root@webdb1 ~]#  iscsiadm -m node
          10.0.1.1:3260,1 iqn.2008-09.com.example:server.target4
          192.168.1.141:3260,1 iqn.2008-09.com.example:server.target4
           
           iscsiadm -m discovery -t st -p 10.0.1.1:3260 //連接上
           iscsiadm -m node -T iqn.2008-09.com.example:server.target4 -p 10.0.1.1 -l
          登錄完成
          執行fdisk 查看是否成功連接
           
          [root@webdb1 ~]# fdisk -l
           
          Disk /dev/sda: 107.4 GB, 107374182400 bytes
          255 heads, 63 sectors/track, 13054 cylinders
          Units = cylinders of 16065 * 512 = 8225280 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x000af23c
           
             Device Boot      Start         End      Blocks   Id  System
          /dev/sda1   *           1        2611    20971520   83  Linux
           
          Disk /dev/sdb: 10.7 GB, 10734311424 bytes
          64 heads, 32 sectors/track, 10237 cylinders
          Units = cylinders of 2048 * 512 = 1048576 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x00000000
           
           
          Disk /dev/sdd: 53.7 GB, 53678177280 bytes
          64 heads, 32 sectors/track, 51191 cylinders
          Units = cylinders of 2048 * 512 = 1048576 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x00000000
           
           
          Disk /dev/sdc: 21.5 GB, 21484431360 bytes
          64 heads, 32 sectors/track, 20489 cylinders
          Units = cylinders of 2048 * 512 = 1048576 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x00000000
           
          已經成功連接。一、服務端配置
          1、首先安裝各種包
          yum search scsi
           
          iscsi-initiator-utils.x86_64 : iSCSI daemon and utility programs
          iscsi-initiator-utils-devel.x86_64 : Development files for iscsi-initiator-utils
          lsscsi.x86_64 : List SCSI devices (or hosts) and associated information
          scsi-target-utils.x86_64 : The SCSI target daemon and utility programs
          libhbalinux.i686 : FC-HBAAPI implementation using scsi_transport_fc interfaces
          libhbalinux.x86_64 : FC-HBAAPI implementation using scsi_transport_fc interfaces
          mtx.x86_64 : SCSI media changer control program
          python-rtslib.noarch : API for RisingTide Systems generic SCSI target
          sdparm.x86_64 : List or change SCSI/SATA disk parameters
          sg3_utils.x86_64 : Utilities for devices that use SCSI command sets
           
           
          執行 yum install -y scsi-target-utils.x86_64 iscsi-initiator-utils.x86_64 iscsi-initiator-utils-devel.x86_64
          其實多裝點也沒有壞處
           
          本機分了100G,在裝系統的時候分了20G,剩余80G沒用
          2、建立分區 
          fdisk /dev/sda  
          我這里建個三個    //建分區步驟略過
          分區建立完畢  一定要 執行 partprobe  命令,寫進內核
          [root@storage 1]# fdisk -l
           
          Disk /dev/sda: 107.4 GB, 107374182400 bytes
          255 heads, 63 sectors/track, 13054 cylinders
          Units = cylinders of 16065 * 512 = 8225280 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x000af23c
           
             Device Boot      Start         End      Blocks   Id  System
          /dev/sda1   *           1        2611    20971520   83  Linux
          /dev/sda2            2611        3916    10482726   83  Linux
          /dev/sda3            3917        6528    20980890   83  Linux
          /dev/sda4            6529       13054    52420095   83  Linux
           
          3.配置tgtd
           vi /etc/tgt/targets.conf 
          在末尾加上如下配置
           
           <target iqn.2008-09.com.example:server.target4>
              direct-store /dev/sda2     # Becomes LUN 1
              direct-store /dev/sda3      # Becomes LUN 2
              direct-store /dev/sda4      # Becomes LUN 3
               initiator-address 10.0.1.2     //允許連接的ip地址
               initiator-address 10.0.1.3
              write-cache off
          </target>
          配置完畢,啟動服務
          service tgtd start
          chkconfig tgtd on
          查看target狀態
          [root@storage ~]# tgt-admin --show
          Target 1: iqn.2008-09.com.example:server.target4
              System information:
                  Driver: iscsi
                  State: ready
              I_T nexus information:
                  I_T nexus: 1
                      Initiator: iqn.1994-05.com.redhat:74bc8f791621
                      Connection: 0
                          IP Address: 10.0.1.3
                  I_T nexus: 2
                      Initiator: iqn.1994-05.com.redhat:9695b6e4df6f
                      Connection: 0
                          IP Address: 10.0.1.2
              LUN information:
                  LUN: 0
                      Type: controller
                      SCSI ID: IET     00010000
                      SCSI SN: beaf10
                      Size: 0 MB, Block size: 1
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: null
                      Backing store path: None
                      Backing store flags: 
                  LUN: 1
                      Type: disk
                      SCSI ID: IET     00010001
                      SCSI SN: beaf11
                      Size: 10734 MB, Block size: 512
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: rdwr
                      Backing store path: /dev/sda2
                      Backing store flags: 
                  LUN: 2
                      Type: disk
                      SCSI ID: IET     00010002
                      SCSI SN: beaf12
                      Size: 21484 MB, Block size: 512
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: rdwr
                      Backing store path: /dev/sda3
                      Backing store flags: 
                  LUN: 3
                      Type: disk
                      SCSI ID: IET     00010003
                      SCSI SN: beaf13
                      Size: 53678 MB, Block size: 512
                      Online: Yes
                      Removable media: No
                      Prevent removal: No
                      Readonly: No
                      Backing store type: rdwr
                      Backing store path: /dev/sda4
                      Backing store flags: 
              Account information:
              ACL information:
                  10.0.1.2
                  10.0.1.3
          二、客戶端配置
          安裝軟件包
          yum install -y iscsi-initiator-utils.x86_64 iscsi-initiator-utils-devel.x86_64
          service iscsid restart
            chkconfig iscsid on
          2.查找發現網絡中的存儲
          [root@webdb1 ~]# iscsiadm -m discovery -t node
          10.0.1.1:3260 via sendtargets
          192.168.1.141:3260 via sendtargets
          192.168.10.100:3260 via sendtargets
          192.168.10.100:3205 via sendtargets
          10.0.1.1:3205 via sendtargets
          3.連接iscsi
           iscsiadm -m node  //發現節點
           
          [root@webdb1 ~]#  iscsiadm -m node
          10.0.1.1:3260,1 iqn.2008-09.com.example:server.target4
          192.168.1.141:3260,1 iqn.2008-09.com.example:server.target4
           
           iscsiadm -m discovery -t st -p 10.0.1.1:3260 //連接上
           iscsiadm -m node -T iqn.2008-09.com.example:server.target4 -p 10.0.1.1 -l
          登錄完成
          執行fdisk 查看是否成功連接
           
          [root@webdb1 ~]# fdisk -l
           
          Disk /dev/sda: 107.4 GB, 107374182400 bytes
          255 heads, 63 sectors/track, 13054 cylinders
          Units = cylinders of 16065 * 512 = 8225280 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x000af23c
           
             Device Boot      Start         End      Blocks   Id  System
          /dev/sda1   *           1        2611    20971520   83  Linux
           
          Disk /dev/sdb: 10.7 GB, 10734311424 bytes
          64 heads, 32 sectors/track, 10237 cylinders
          Units = cylinders of 2048 * 512 = 1048576 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x00000000
           
           
          Disk /dev/sdd: 53.7 GB, 53678177280 bytes
          64 heads, 32 sectors/track, 51191 cylinders
          Units = cylinders of 2048 * 512 = 1048576 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x00000000
           
           
          Disk /dev/sdc: 21.5 GB, 21484431360 bytes
          64 heads, 32 sectors/track, 20489 cylinders
          Units = cylinders of 2048 * 512 = 1048576 bytes
          Sector size (logical/physical): 512 bytes / 512 bytes
          I/O size (minimum/optimal): 512 bytes / 512 bytes
          Disk identifier: 0x00000000
           
          已經成功連接。



          上一篇:kvm啟動報錯與selinux的設置相關解決方法
          下一篇:解決VNC Viewer 連接閃退不斷重新連接的問題

          相關熱詞搜索:centos iscsi
          主站蜘蛛池模板: 成人激情免费视频| 欧美浓毛大泬视频| 国产免费内射又粗又爽密桃视频| 538精品视频在线观看mp4| 少妇一晚三次一区二区三区| 久久亚洲精品国产亚洲老地址 | 国产精品99久久久久久宅男| 99久久综合狠狠综合久久| 强行扒开双腿猛烈进入| 久久www成人看片| 日韩在线视频免费播放| 亚洲一级黄色大片| 欧美日韩国产58香蕉在线视频| 人妻丰满熟AV无码区HD| 精品久久天干天天天按摩| 四虎影视永久免费视频观看| 车上做好紧我太爽了再快点| 国产成人3p视频免费观看| 亚洲精品短视频| 国产精品亲子乱子伦xxxx裸| 4hu四虎永久免在线视| 在公车上拨开内裤进入毛片| a级毛片毛片免费观看久潮喷| 好男人好资源在线观看免费| 一本色道久久综合狠狠躁篇| 成人国产午夜在线视频| 中文字幕的电影免费网站| 日本在线视频www色| 久久无码专区国产精品| 日韩精品人妻系列无码专区免费| 亚洲av无码一区二区三区不卡 | 欧美激情乱人伦| 亚洲黄色中文字幕| 理论亚洲区美一区二区三区| 免费看美女隐私直播| 精品国产一区二区三区www| 午夜国产福利在线| 精品无码成人久久久久久| 变态拳头交视频一区二区| 美国一级毛片免费| 午夜福利一区二区三区高清视频|