目录

网络存储

网络存储(Network Storage)是基于数据存储的一种,网络存储结构大致分为三种:直连式存储(DAS:Direct Attached Storage)、网络存储设备(NAS:Network Attached Storage)和存储网络(SAN:Storage Area Network),由于NAS对于普通消费者而言较为熟悉,所以一般网络存储都指NAS。

ISCSI

iSCSI:Internet小型计算机系统接口(iSCSI:Internet Small Computer System Interface),是一个供硬件设备使用的可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上运行SCSI协议。iSCSI技术是一种新储存技术,该技术是将现有SCSI接口与以太网络(Ethernet)技术结合,使服务器可与使用IP网络的储存设备互相交换数据。iSCSI的主要功能是在TCP/IP网络上的主机系统(启动器Initiator)和存储设备(目标器Target)之间进行大量数据的封装和可靠传输过程。此外,iSCSI提供了在IP网络上封装的SCSI命令,且运行在TCP上。

技术原理:ISCSI实现了在IP协议基础上运行SCSI协议,将现有的SCSI接口和以太网技术结合。实现了ISCSI服务器可以使用IP网络的存储装备间互相交换数据。

1. Port:TCP 3260

2. ISCSI存储设备使用iqn标识符来命名

ipn.YYYY-MM.反向域名.识别标识

How to setup ISCSI server

SCSI Commands

Server Side

step1 install software

yum install scsi-target-utils

serviceName: tgtd

commandName:tgtadm

step2 Create target object

service tgtd start
tgtadm -L iscsi -o new -m target -t 1 -Y iqn.2015-11.com.fan.JustShow
-L:assign drive type
-o:assign operation type
-m:assign mode
-t:assign target number
-T:assign target identification
new:Create the new one

step3. Check target detail list infomation

tgtadm -L iscsi -o show -m target

step4. Create LUN(逻辑单元)

tgtadm -L iscsi -o new -m logicalunit -t 1 -l 1 -b /dev/sdName
-l assign LUN

step5. Bind Client’s IPAddr to LUN

tgtadm -L iscsi -o bind -m target -t 1 -I clientIP

step6. Show the Account info

sgt-admin -S

NOTE

If the AccountInfo is null, anyone can use the target.

If ACLInfo is null, no people can use the target.

The IPInfo will output in the ACLInfo when the ip bind to target.

Client Side

step1. Install iscsi-initiator-utils

yum install iscsi-initiator-utils

serviceName:iscsi

commandName:iscsiadm

step2. Find usable target in local client, get usable target’s iqnFlag

service iscsi start
iscsiadm -m discovery -t sendtargets -p serverIP

step3. Connect service target share device

iscsiadm -m node -T iqnFlag -l
-l login

step4. After connect server find usable dervice in local

lsscsi

step5. After connect ISCSI server find the target config file

ls -R /var/lib/iscsi/nodes

step6. Formatling the ISCSI share device when the ISCSI device haven’t FS. And mount the device.

NOTE: mount the device at the same time add option -netdev to /etc/fstab, the meaning is monut the device after connect the network.

mkfs.ext4 /dev/sdName
mount -t /dev/sdName /mnt/iscsi

step7. unload ISCSI drvice.

iscsiadm -m node -T iqnFlag -u  #For a short time ,logout
iscsiadm -m node -T iqnFlag -0 #Delete

Edit the ISCSI configuration file

ServerSide

vim /etc/tgt/target.conf

<target iqn.2015-01.com.fan.jmilk:lvm>
backing-store /dev/vg_iscsi/lv_iscsi
direct-store /dev/sda2
initator-address 192.168.0.1 #Bind client IP
incominguser jmilk #authentication parameter
</target>

Step2. restart the tgt service

service tgtd restart

ClientPort

step1.

iscsiadm -m discovery -t sendtargets -p serverIP

step2. Defined connect authentication method, create auth user.

 iscsiadm -m node -o update -T iqnFlag -n node.session.auth authmethod -V CHAP
iscsiadm -m node -o update -T iqnFlag -n node.session.auth username -V jmilk
iscsiadm -m node -o update -T iqnFlag -n node.session.auth passwork -V jmilk.com

step3.

iscsiadm -m node -T iqnFlag -l

step4.

lsscsi

Linux_ISCSI服务器的更多相关文章

  1. App开发:模拟服务器数据接口 - MockApi

    为了方便app开发过程中,不受服务器接口的限制,便于客户端功能的快速测试,可以在客户端实现一个模拟服务器数据接口的MockApi模块.本篇文章就尝试为使用gradle的android项目设计实现Moc ...

  2. 闰秒导致MySQL服务器的CPU sys过高

    今天,有个哥们碰到一个问题,他有一个从库,只要是启动MySQL,CPU使用率就非常高,其中sys占比也比较高,具体可见下图. 注意:他的生产环境是物理机,单个CPU,4个Core. 于是,他抓取了CP ...

  3. 闲来无聊,研究一下Web服务器 的源程序

    web服务器是如何工作的 1989年的夏天,蒂姆.博纳斯-李开发了世界上第一个web服务器和web客户机.这个浏览器程序是一个简单的电话号码查询软件.最初的web服务器程序就是一个利用浏览器和web服 ...

  4. SignalR系列续集[系列8:SignalR的性能监测与服务器的负载测试]

    目录 SignalR系列目录 前言 也是好久没写博客了,近期确实很忙,嗯..几个项目..头要炸..今天忙里偷闲.继续我们的小系列.. 先谢谢大家的支持.. 我们来聊聊SignalR的性能监测与服务器的 ...

  5. 使用 Nodejs 搭建简单的Web服务器

    使用Nodejs搭建Web服务器是学习Node.js比较全面的入门教程,因为要完成一个简单的Web服务器,你需要学习Nodejs中几个比较重要的模块,比如:http协议模块.文件系统.url解析模块. ...

  6. 通过ProGet搭建一个内部的Nuget服务器

    .NET Core项目完全使用Nuget 管理组件之间的依赖关系,Nuget已经成为.NET 生态系统中不可或缺的一个组件,从项目角度,将项目中各种组件的引用统统交给NuGet,添加组件/删除组件/以 ...

  7. 谈谈如何使用Netty开发实现高性能的RPC服务器

    RPC(Remote Procedure Call Protocol)远程过程调用协议,它是一种通过网络,从远程计算机程序上请求服务,而不必了解底层网络技术的协议.说的再直白一点,就是客户端在不必知道 ...

  8. 游戏服务器菜鸟之C#初探一游戏服务

    本人80后程序猿一枚,原来搞过C++/Java/C#,因为工作原因最后选择一直从事C#开发,因为读书时候对游戏一直比较感兴趣,机缘巧合公司做一个手游的项目,我就开始游戏服务器的折腾之旅. 游戏的构架是 ...

  9. 无法向会话状态服务器发出会话状态请求。请确保 ASP.NET State Service (ASP.NET 状态服务)已启动,并且客户端端口与服务器端口相同。如果服务器位于远程计算机上,请检查。。。

    异常处理汇总-服 务 器 http://www.cnblogs.com/dunitian/p/4522983.html 无法向会话状态服务器发出会话状态请求.请确保 ASP.NET State Ser ...

随机推荐

  1. springboot 配置

    springboot 配置文件中属性变量引用方式@@解析 这种属性应用方式是field_name=@field_value@. 两个@符号是springboot为替代${}属性占位符产生,原因是${} ...

  2. 1. Docker快速入门(仓库,镜像,容器)

    参考阿里云文档:https://help.aliyun.com/document_detail/51853.html?spm=a2c4g.11186623.6.820.RaToNY 参考菜鸟教程文档: ...

  3. mysql,oracle,sql server数据库默认的端口号,端口号可以为负数吗?以及常用协议所对应的缺省端口号

    mysql,oracle,sql server数据库默认的端口号? mysql:3306 Oracle:1521 sql server:1433 端口号可以为负吗? 不可以,端口号都有范围的,0~65 ...

  4. 前端开发HTML&css入门——CSS&选择器练习

    CSS 层叠样式表 (Cascading Style Sheets)css可以用来为网页创建样式表,通过样式表可以对网页进行装饰.所谓层叠,可以将整个网页想象成是一层一层的结构,层次高的将会覆盖层次低 ...

  5. Qt Creator的初步使用

    http://c.biancheng.net/view/1804.html 启动 Qt Creator,出现如图 1 所示的主窗口: 图 1 Qt Creator主窗口 Qt Creator 的界面很 ...

  6. 高可用4层lvs——keepalived

    搭建方式: node01: ipvsadm -C ifconfig eth0:2 down --------------------------------- node01,node04安装keepa ...

  7. VB Open 函数详解 打开、关闭、读、写文件

    (一)打开和关闭文件      1.顺序文件     打开顺序文件,我们可以使用Open语句.它的格式如下:Open pathname For [Input |Output |Append] As [ ...

  8. Java内存模型(JMM)的可见性

    JMM(Java Memory Model)内存模型之可见性 JMM是Java内存模型的缩写,本身是一种抽象的概念,并不真实存在,它描述的是一组规则或规范,通过这组规范定义了程序中各个变量(包括实例字 ...

  9. 通过form提交 django的安全机制

    通过form提交 在form表单里面需要添加{%csrf_token%} 这样当你查看页面源码的时候,可以看到form中有一个input是隐藏的 总结原理:当用户访问login页面的时候,会生成一个c ...

  10. 51nod1790 输出二进制数

    题目描述 题解 过于真实 LJ卡常题 一个显然的dp: 设f[i][j]表示做完前i个,最后一段为j+1~i的方案(最小值同理) 那么f[i][j]=min(f[i-j-1][k]),其中k~j-1要 ...