• iscsi 学习


    iscsi-initiator-utils-6.2.0.872-10.el6.x86_64

    iscsi-initiator-utils-6.2.0.873-32.el7.x86_64

    在el7中, iscsi-initiator-utils 依赖 iscsi-initiator-utils-iscsiuio-6.2.0.873-32.el7.x86_64。

    命令:

    el6下的命令

    /sbin/brcm_iscsiuio
    /sbin/iscsi-iname


    /sbin/iscsiadm

       -m node --logoutall=automatic

    [root@vClass-J5j3G nodes]# iscsiadm -h
    iscsiadm -m discovery2 [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -Dl ] ] | [ [ -p ip:port -t type] [ -o operation ] [ -n name ] [ -v value ] [ -lD ] ] 
    iscsiadm -m discovery [ -hV ] [ -d debug_level ] [-P printlevel] [ -t type -p ip:port -I ifaceN ... [ -l ] ] | [ [ -p ip:port ] [ -l | -D ] ] 
    iiscsiadm -m node [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -L all,manual,automatic ] [ -U all,manual,automatic ] [ -S ] [ [ -T targetname -p ip:port -I ifaceN ] [ -l | -u | -R | -s] ] [ [ -o  operation  ] [ -n name ] [ -v value ] ]
    iscsiadm -m session [ -hV ] [ -d debug_level ] [ -P  printlevel] [ -r sessionid | sysfsdir [ -R | -u | -s ] [ -o operation ] [ -n name ] [ -v value ] ]
    iscsiadm -m iface [ -hV ] [ -d debug_level ] [ -P printlevel ] [ -I ifacename ] [ [ -o  operation  ] [ -n name ] [ -v value ] ]
    iscsiadm -m fw [ -l ]
    iscsiadm -m host [ -P printlevel ] [ -H hostno ]
    iscsiadm -k priority


    /sbin/iscsid

    Usage: iscsid [OPTION]
    Open-iSCSI initiator daemon.
      -c, --config=[path]     Execute in the config file (/etc/iscsi/iscsid.conf).
      -i, --initiatorname=[path]     read initiatorname from file (/etc/iscsi/initiatorname.iscsi).
      -f, --foreground        make the program run in the foreground
      -d, --debug debuglevel  print debugging information
      -u, --uid=uid           run as uid, default is current user
      -g, --gid=gid           run as gid, default is current user group
      -p, --pid=pidfile       use pid file (default /var/run/iscsid.pid).
      -h, --help              display this help and exit
      -v, --version           display version and exit
    

      


    /sbin/iscsistart

    el7 下的命令

    在el6中的命令 /usr/sbin/iscsiuio  移动到了  iscsi-initiator-utils-iscsiuio-6.2.0.873-32.el7.x86_64 rpm中。

    /usr/sbin/iscsi-iname
    /usr/sbin/iscsiadm
    /usr/sbin/iscsid
    /usr/sbin/iscsistart

    服务:

    el6

    /etc/rc.d/init.d/iscsi

      执行程序:  /sbin/iscsiadm

      配置文件:  /etc/iscsi/initiatorname.iscsi        保存当前 initiator 的 IQN

      临时数据: /var/lib/iscsi

           /var/lib/iscsi/nodes        挂载点     

                    ifaces        

                  isns

                  send_targets

                   slp

                 static

     
    /etc/rc.d/init.d/iscsid

      执行程序: /sbin/iscsid

      配置文件:   /etc/iscsi/iscsid.conf

      使用内核: modprobe -q iscsi_tcp

            modprobe -q ib_iser
            modprobe -q cxgb3i
            modprobe -q bnx2i
            modprobe -q be2iscsi

          依赖守护:  brcm_iscsiuio

    el7

    /usr/lib/systemd/system/iscsiuio.service

    /usr/lib/systemd/system/iscsi-shutdown.service
    /usr/lib/systemd/system/iscsi.service
    /usr/lib/systemd/system/iscsid.service

    配置:

    el6

    /etc/iscsi/iscsid.conf

    el7

    /etc/iscsi/iscsid.conf

    基本操作

    探测存储设备

    [root@vClass-J5j3G nodes]# iscsiadm -m discovery -t sendtargets -p 127.0.0.1:3260
    iscsiadm: cannot make connection to 127.0.0.1:3260 (111)
    iscsiadm: connection to discovery address 127.0.0.1 failed
    iscsiadm: cannot make connection to 127.0.0.1:3260 (111)
    iscsiadm: connection to discovery address 127.0.0.1 failed
    iscsiadm: cannot make connection to 127.0.0.1:3260 (111)
    iscsiadm: connection to discovery address 127.0.0.1 failed
    iscsiadm: cannot make connection to 127.0.0.1:3260 (111)
    iscsiadm: connection to discovery address 127.0.0.1 failed
    iscsiadm: cannot make connection to 127.0.0.1:3260 (111)
    iscsiadm: connection to discovery address 127.0.0.1 failed
    iscsiadm: cannot make connection to 127.0.0.1:3260 (111)
    iscsiadm: connection to discovery address 127.0.0.1 failed
    iscsiadm: connection login retries (reopen_max 5) exceeded
    iscsiadm: Could not perform SendTargets discovery.

    将探测到的存储挂载到本地

    root@rhel2 init.d]#iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.af7b14fe4761 -p 1.1.1.1:3260 -l 
    Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.af7b14fe4761, portal: 1.1.1.1,3260] 
    Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.af7b14fe4761, portal: 1.1.1.1,3260]: successful

    查找当前系统的

    [root@vClass-J5j3G iscsi]# iscsiadm -m discovery
    localhost:3260:3260 via sendtargets
    127.0.0.1:3260 via sendtargets

    使用 iscsiadm 命令发现服务端并查看服务端的 IQN

    #iscsiadm -m discovery -t sendtargets -p 192.168.100.200

     

    使用 iscsiadm 令连接服务端

    使用 fdisk -l 查看共享的逻辑磁盘

    使用 -u 参数可以登出

     再次使用fdisk -l 查看共享的磁盘不见了。
     

     

    搜寻磁盘阵列:iscsiadm –mode discovery –type sendtargets –portal 192.168.1.230

    显示磁盘阵列:iscsiadm –mode node

    登录磁盘阵列:iscsiadm -m node -T TARGETSNAME -p 192.168.1.230:2360 –l

     

     

    参考:

      Linux挂载ISCSI TARGET磁盘    https://wenku.baidu.com/view/566125db5022aaea998f0fdd.html?re=view

      

     

     

     

  • 相关阅读:
    简单事务使用
    sql in(1,2,3)参数化查询,错误在将 varchar 值 '1,2,3,4' 转换成数据类型 int 时失败
    处理金额小数点后的零
    json时间格式化问题
    读取接口XML和批量导入数据SqlBulkCopy
    list操作 foreach和for的区别
    10.16 一起去修仙 !mv
    10.9 自动生成计算题输入答案判断正误;计算BMI
    9.25九道题
    9.18作业 杨月(1636050091)练习题
  • 原文地址:https://www.cnblogs.com/doscho/p/6758446.html
Copyright © 2020-2023  润新知