> 文章列表 > ISCSI个人理解与简要说明

ISCSI个人理解与简要说明

ISCSI个人理解与简要说明

ISCSI个人理解与简要说明

  • 一、如何理解ISCSI
    • 二、iscsi 命令
      • iscsiadm(管理客户端)
      • tgtadm(管理服务端)
    • 三、ISCSI中的概念
    • 四、从DAS,NAS,SAN的角度扩展理解ISCSI

一、如何理解ISCSI

理解一个东西,一般要从自己了解的东西出发。
ISCSI个人理解与简要说明
了解图中SCSI、TCP、IP就能明白,ISCSI充当的是SCSI和TCP/IP之间的翻译,作为SCSI和TCP/IP之间的桥梁,让SCSI传输的数据可以在IP 网络上传输。

SCSI: Small Computer System Interface,SCSI是计算机硬件之间连接传输数据的一种技术,不涉及网络传输。
TCP/IP为网络传输的相关协议。

二、iscsi 命令

iscsi对应的驱动为:

[root@zlnode761 vdbench50403]# rpm -qa|grep iscsi
iscsi-initiator-utils-iscsiuio-6.2.0.874-20.el7_9.x86_64
iscsi-initiator-utils-6.2.0.874-20.el7_9.x86_64

这个安装将iscsid、iscsiadm安装到 /sbin 目录下,它还将把默认的配置文件安装到/etc/iscsi/目录下:
/etc/iscsi/iscsid.conf:所有刚发起的iSCSI session默认都将使用这个文件中的参数设定。
/etc/iscsi/initiatorname.iscsi:软件iSCSI initiator的intiator名称配置文件。

iscsiadm(管理客户端)

iscsiadm是用来管理(更新、删除、插入、查询)iSCSI配置数据库文件的命令行工具,用户能够用它对iSCSI nodes、sessions、connections和discovery records进行一系列的操作。

常用option:

-m, --mode op 
specify the mode. op must be one of discovery, discoverydb, node, fw, host iface or session.
-t, --type=type
type must be sendtargets (or abbreviated as st), slp, isns or fw. 
-l, --login
For node and fw mode, login to a specified record. For discovery mode, login to all discovered targets.
-p, --portal=ip[:port]
Use target portal with ip-address ip and port. If port is not passed in the default port value is 3260.
-T, --targetname=targetname
-s, --stats  
Display session statistics.  This option when used with host mode, displays host statistics.
-S, --show
When displaying records, do not hide masked values, such as the CHAP secret (password).
-u, --logout
logout for a specified record.
-o, --op=op
Specifies a database operator op. op must be one of new, delete, update, show or nonpersistent.
-U, --logoutall=[all,manual,automatic]
-L, --loginall=[all|manual|automatic]

Discover type:

   iSCSI defines 3 discovery types: SendTargets, SLP, and iSNS.SendTargetsA native iSCSI protocol which allows each iSCSI target to send a list of available targets to the initiator.SLP    Optionally an iSCSI target can use the Service Location Protocol (SLP) to announce the available targets. The initiator can either implement SLP queries directly or can use a  sepa‐ rate tool to acquire the information about available targets.iSNS   iSNS  (Internet Storage Name Service) records information about storage volumes within a larger network. To utilize iSNS, pass the address and optionally the port of the iSNS server to do discovery to.fw     Several NICs and systems contain a mini iSCSI initiator which can be used for boot. To get the values used for boot the fw option can be used.  Doing fw discovery,  does  not  store persistent records in the node or discovery DB, because the values are stored in the system's or NIC's resource. Performing  fw  discovery  will print the portals, like with other discovery methods. To see other settings like CHAP values and initiator settings, like you would in node mode, run "iscsiadm -m fw".fw support in open-iscsi is experimental. The settings and iscsiadm syntax and output format may change. iscsiadm supports the iSNS (isns) or SendTargets (st) discovery type. An SLP implementation is under development.
列出所有target
iscsiadm -m node连接所有target
iscsiadm -m node -L all连接指定target
iscsiadm -m node -T iqn.1994-05.com.redhat:426ce49bee9 -p 172.29.88.62 -l查看服务端配置信息
iscsiadm -m node -o show -T iqn.2018-01.com.h3c.onestor:d0ac9774ca954f48bcc0a5a6c560a8d6查看目前 iSCSI target 连接状态
iscsiadm -m session断开指定target
iscsiadm -m node -T iqn... -p 172.29.88.62 --logout删除所有node信息
iscsiadm -m node --op delete查看discover的target
iscsiadm -m discoveryiscsiadm -m discovery -t st -p  172.17.100.72   -l #登录
iscsiadm -m discovery -t st -p  172.17.100.72   -u #登出iscsiadm -m node -U all # 登出所有target
iscsiadm -m node -L all # 登录所有target

tgtadm(管理服务端)

tgtadm是一个服务器端管理配置工具,它也是一个模式化的命令,其常见的模式有target、logicalunit、account

三、ISCSI中的概念

iscsi initiator指的是客户端
iscsi node指的是管理target的模式的名称
iscsi target指的是服务端,target名称就是iqn开头的设备唯一的编码

四、从DAS,NAS,SAN的角度扩展理解ISCSI

DAS:Direct Attached Storage,直接附加存储,存储设备通过SCSI接口电缆直接连接到服务器的,存储设备不带有任何操作系统。
ISCSI个人理解与简要说明

NAS:Network Attached Storage,网络附加存储,NAS是基于IP协议的文件级数据存储,支持现有的网络技术,比如以太网,FDDI等。
ISCSI个人理解与简要说明

SAN:Storage Area Network,存储区域网络,这是一个共享的高速存储网络,存储设备位于服务器的后端,且存储设备和服务器之间一般通过光钎(FC)交换机相连,因此传输速率比较快。当然也可以通过IP网络来继续传输,不过这对于网络带宽来说要求非常大的。
ISCSI个人理解与简要说明

DAS服务器和存储设备之间使用SCSI总线物理连接,存储与服务器之间不存在网络传输,存储设备不带有操作系统,SCSI总线上传输的为数据块,NAS是基于网络传输的文件存储,存储设备带有操作系统,网络上之间传输的对象就是文件,通过网络提供存储服务,SAN的形式为存储设备和服务器之间通过交换机连接。本质NAS像是内置的DAS,作为服务器通过网络提供文件存储服务。外置DAS和SAN的区别就是SAN的存储设备是通过网络和服务器连接,DAS是通过SCSI总线等硬件连接。

ISCSI个人理解与简要说明
ISCSI个人理解与简要说明

Online Tetris