您的ISCSI够快吗?

您的ISCSI够快吗?

Neil Cameron

       iSCSI是项极其优秀的技术。iSCSI让用户得以用非常廉价而简易的方式来构建SAN,而无需具备FibreChannel的专业知识或耗费巨资去购置Fibre Channel的设备。只需唾手可得的网络设备,在现有的设备上添加存储设施即可。就算再上升到“发烧友”的级别,要构建共享访问、集群或其他高端性能也都可以轻松实现。

       许多厂商都提供大致免费的iSCSI目标(现在的Windows服务器中甚至就有一个),并且,几乎每个操作系统都有一个免费的软件启动器与这些目标相连。虽然我们可以喋喋不休地争辩到底软件启动器和硬件启动器孰优孰劣,但一个不争的事实是,软件启动器十分有效,故而大多数iSCSI硬件启动器的厂商都已经自动退出了竞争。

       初次接触这些概念的看官们,这里先解释一下。“目标”所指的是带有存储的机器,而“启动器”则指的是通过网络与该存储设备相连的机器。一目了然吧?

       我已经把iSCSI的概念大幅简化了一番,再来看看它的性能表现吧。多数任务iSCSI都应付有余,但根据我个人的经验,它在随机读/写方面尚嫌不足——原因是小尺寸的读和写会带来很可观的网络开销。

       那么,有什么办法来解决这个难题呢?

       是不是花费千百万的巨款购置声名赫赫的某家厂商的高大上的iSCSI目标——其实该设备远远超出了你的需求?还是,将随机读和写高速缓存到启动器这边,好让那些经常访问到的小块实际上无需在iSCSI网络中来回传送?

       后一种方案看上去很有吸引力,而事实上也非常易于实现。Adaptec by PMC有一款名为maxCache Plus的产品,即是一款进行高速缓存和分层的软件,已经内置于所有8系列Q”控制器(如8885Q)之内。在发布该软件的当前版本之先,缓存还只能针对与控制器相连的设备进行,而iSCSI目标肯定不在其列。但是,现在有了“maxCache Plus”,就可以对服务器中任何存储进行缓存或分层操作,其中也包括iSCSI目标,这些目标其实就是位于网络中某处的盘片,只是以服务器中盘片的形式呈现着。

       那么,现在来插入一块8Q控制器,连上一块或多块SSD(甚至无需做成RAID——只需将其当成单个裸盘使用),然后在现有的逻辑设备(盘片)上加上缓存即可——运用我们称之为“CachedLD”(高速缓存的逻辑设备)功能。

       该逻辑设备既可以是iSCSI目标、主板上的一个板上RAID阵列,亦或甚至是RAID卡竞争厂商的RAID阵列……此外,它还有一个重大优点,就是无须重新配置服务器上的现有数据,或对服务器配置进行任何修改!听起来难以置信吧?!但其实际的工作方式正是如此便捷平滑。

       事实上,与其购置昂贵的iSCSI方案,您大可以采用廉价的硬件加上基本免费的软件来创建自己的iSCSI目标——构造一个价格非常低廉的网络存储解决方案——然后在服务器上进行随机读写的加速。我们当然希望您会在自己搭建的iSCSI盒子里采用Adaptecby PMC RAID卡。但不言而喻的一点是,您势必会采用免费的Linux软件RAID。不论如何,开始动手吧!

       顺便提一句,SSD如果坏掉了(当采用单个SSD时)会发生什么呢?——您的数据绝对毫发无损!——仅仅会回到安装高速缓存之前的原始性能——CachedLD决不会破坏您的数据!

 

Is your ISCSI fast enough?

       iSCSI is a great technology. Itgives you the ability to create SANs very cheaply and easily, without having tobecome a guru in Fibre Channel or put yourself into deep debt buying all the Fibre equipment. By using easily available networking equipment, you can add storage to existing boxes, even if you want to go crazy and do shared access,clustering or other high-end features.

       A lot of vendors provide basically free iSCSI targets (there’s even one in Windows Server these days),and almost every OS has a free software initiator to connect to those targets.Yes, we can bang on about whether software or hardware initiators are better, but software initiators are free and work so well that most iSCSI hardware initiator vendors have stopped bothering.

       For the uninitiated, a targetis the machine with the storage, and an initiator is the machine connecting across the network to that storage – simple (if you say it quickly, but in reality it’s not that hard these days).

       So now that I’ve oversimplified iSCSI, let’s look at its performance. It’s pretty good for most things, but inmy experience suffers in the random read/write area – small read and writes carry quite a bit of network overhead, etc.

       So what can be done about that?

       Hmmm … spend millions with a big-name vendor on a super-duper iSCSI target that’s more than you need, or …cache the random reads and writes at the initiator end, so that those small,frequently used blocks don’t actually travel back and forth across the iSCSInetwork.

       The latter sounds very attractive, and in fact it is very easy to achieve. Adaptec by PMC has a product calledmaxCachePlus, which is caching and tiering software, and is built into all 8 Series “Q” controllers (e.g. 8885Q). Now prior to this version of the software that works with these controllers, caching only worked on devices attached to the controller, which an iSCSI target definitely isn’t. However now with“maxCache Plus”, you can cache or tier any storage in your server, including iSCSI targets that are in fact disk drives sitting somewhere out on thenetwork, but just appear to be drives inside the server.

        So…plug in an 8Q controller,connect 1 or more SSDs (you don’t even need to make them RAID – you can usethem as single raw disks), then add caching to an existing logical device(disk) – using what we call “CachedLD” (Cached Logical Device).

        That logical device can be aniSCSI target, an on-board RAID array off the motherboard, or even a RAID array from a competing RAID card vendor … and did I mention that you don’t need to reconfigure the existing data on the server, or make any changes to the server configuration? That sounds too good to be true, but in fact it works seamlessly.

        You could in fact make your owniSCSI target using inexpensive hardware and pretty much free software to create a very affordable network storage solution – then accelerate the random readsand writes to that locally in your server, rather than spending a fortune in the iSCSI arena.  Hopefully you’ll use an Adaptec by PMC RAID card in that iSCSI box, but more than likely you’ll use free Linux software RAID – what the heck, just do it.

        By the way … what happens if the SSD fails (in the case of using a single SSD) – absolutely nothing to your data – you just go back to original performance before installing caching –CachedLD cannot hurt your data.

        Now that’s something to think about.

 

<think>用户问的是“iscsi target 能绑定IP吗?”,我需要先理解这个问题。首先,iSCSI Target通常指的是iSCSI存储服务器端,用户可能想知道是否可以将iSCSI服务绑定到特定的IP地址,而不是监听所有网络接口。 首先,我应该回忆iSCSI Target的配置方式。常见的iSCSI Target软件有targetcli(用于Linux的LIO Target),还有可能用iscsi-target-utils等。在配置时,通常需要指定监听的IP地址和端口,默认可能是0.0.0.0,即所有接口,但用户可能希望限制为特定IP,比如内网IP,提高安全性。 接下来,我需要确认不同iSCSI Target软件的配置方法。比如,使用targetcli时,在创建Target时,可以通过设置`incominguser`和`outgoinguser`,但更关键的是在配置ACL或网络参数时指定IP。或者,在防火墙中限制端口访问,但用户的问题是关于Target服务本身是否支持绑定IP。 另外,可能需要检查iSCSI Target的配置文件,比如在targetcli中,通过`targetcli`命令进入交互界面,创建Target后,配置Portal,指定IP和端口。例如,添加一个Portal到特定IP,这样iSCSI服务就会只监听该IP。 还需要考虑端口,iSCSI默认使用3260端口,TCP。绑定IP的话,需要确保Target服务在启动时监听指定的IP和端口,而不是所有接口。这可能涉及到配置文件中的设置,或者在创建Target时明确指定IP。 另外,用户可能关心的是如何配置,所以需要给出具体的步骤,比如在targetcli中如何操作,或者修改配置文件的方法。同时,可能需要提到防火墙的设置,确保允许该IP和端口的流量,但用户的问题主要是关于Target是否能绑定IP,所以重点在服务配置。 还要注意,不同的iSCSI Target实现可能有不同的配置方式,比如LIO Target、SCST、或iscsi-target-utils,需要说明常见的情况,尤其是Linux下的主流工具。 最后,总结答案:是的,iSCSI Target可以绑定到特定IP,通过配置Target服务监听指定的IP地址,通常在创建Target或配置Portal时指定,确保服务只在该IP上响应iSCSI请求,提高安全性和管理性。</think>是的,iSCSI Target(存储服务器端)可以绑定到特定的IP地址,通过配置Target服务监听指定的IP地址,而非默认的所有网络接口(0.0.0.0)。以下是主流iSCSI Target工具(如Linux的LIO Target)的配置方法: ### **配置步骤(以`targetcli`为例)** 1. **进入`targetcli`交互界面**: ```bash targetcli ``` 2. **创建或选择Target**(若已存在可跳过): ```bash /backstores/block create name=my_storage dev=/dev/sdb # 假设使用/dev/sdb作为存储 /iscsi create iqn.2024-01.com.example:mytarget ``` 3. **配置Portal(绑定IP和端口)**: ```bash # 进入Target的Portal配置路径 cd /iscsi/iqn.2024-01.com.example:mytarget/tpg1/portals # 删除默认的0.0.0.0(所有接口) delete 0.0.0.0 3260 # 添加指定IP(如192.168.1.100)和端口(默认3260) create 192.168.1.100 ``` 4. **保存配置并退出**: ```bash saveconfig exit ``` 5. **重启iSCSI Target服务**: ```bash systemctl restart target ``` ### **关键说明** - **Portal的作用**:Portal定义了iSCSI Target监听的IP和端口,通过指定IP可限制服务仅在该地址响应iSCSI请求。 - **默认行为**:未配置Portal时,Target默认监听所有接口(0.0.0.0),存在安全风险。 - **多IP支持**:可添加多个Portal(如`create 192.168.1.101`),实现多IP监听。 ### **验证配置** 查看Target监听的IP和端口: ```bash ss -tlnp | grep 3260 ``` 输出应包含`192.168.1.100:3260`,表示绑定成功。 ### **其他iSCSI Target工具** - **iscsi-target-utils**(旧版):通过修改`/etc/tgt/targets.conf`,在`target`块中添加`incominguser`和`outgoinguser`,并指定`ip`参数(如`ip=192.168.1.100`)。 - **SCST**:在SCST配置文件中,通过`handler`或`device`块指定`allow_ips`参数限制访问IP。 通过绑定IP,可有效控制iSCSI服务的访问范围,提升存储服务的安全性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值