Linux_ISCSI服务器

本文涉及的产品
文件存储 NAS,50GB 3个月
简介: 目录目录网络存储ISCSIHow to setup ISCSI serverSCSI CommandsServer SideClient SideEdit the ISCSI configuration fileServerSideCli...

目录

网络存储

网络存储(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
相关实践学习
函数计算部署PuLID for FLUX人像写真实现智能换颜效果
只需一张图片,生成程序员专属写真!本次实验在函数计算中内置PuLID for FLUX,您可以通过函数计算+Serverless应用中心一键部署Flux模型,快速体验超写实图像生成的魅力。
相关文章
|
2月前
|
弹性计算 安全 Linux
阿里云服务器ECS安装宝塔Linux面板、安装网站(新手图文教程)
本教程详解如何在阿里云服务器上安装宝塔Linux面板,涵盖ECS服务器手动安装步骤,包括系统准备、远程连接、安装命令执行、端口开放及LNMP环境部署,手把手引导用户快速搭建网站环境。
|
4月前
|
Linux 网络安全 数据安全/隐私保护
使用Linux系统的mount命令挂载远程服务器的文件夹。
如此一来,你就完成了一次从你的Linux发车站到远程服务器文件夹的有趣旅行。在这个技术之旅中,你既探索了新地方,也学到了如何桥接不同系统之间的距离。
551 21
|
3月前
|
Java Linux 网络安全
Linux云端服务器上部署Spring Boot应用的教程。
此流程涉及Linux命令行操作、系统服务管理及网络安全知识,需要管理员权限以进行配置和服务管理。务必在一个测试环境中验证所有步骤,确保一切配置正确无误后,再将应用部署到生产环境中。也可以使用如Ansible、Chef等配置管理工具来自动化部署过程,提升效率和可靠性。
347 13
|
7月前
|
安全 Java Linux
Websoft9:为开发者打造的高效 Linux 服务器面板
Websoft9 是一款以开源应用部署与管理为核心的服务器面板,采用“环境即服务”模式。它通过运行环境标准化、自动化配置、安全融合和资源管理四个方面实现平台与环境的深度协同。支持多语言框架预集成、云原生组件整合,提供 200+ 应用模板一键部署,并具备全流程安全防护和统一资源监控能力,助力开发者高效管理和扩展应用环境。
194 0
|
3月前
|
监控 Linux 网络安全
FinalShell SSH工具下载,服务器管理,远程桌面加速软件,支持Windows,macOS,Linux
FinalShell是一款国人开发的多平台SSH客户端工具,支持Windows、Mac OS X和Linux系统。它提供一体化服务器管理功能,支持shell和sftp同屏显示,命令自动提示,操作便捷。软件还具备加速功能,提升访问服务器速度,适合普通用户和专业人士使用。
244 0
|
3月前
|
存储 安全 Linux
Linux服务器上安装配置GitLab的步骤。
按照以上步骤,一个基础的GitLab服务应该运行并可以使用。记得定期检查GitLab官方文档,因为GitLab的安装和配置步骤可能随着新版本而变化。
248 0
|
5月前
|
存储 安全 Ubuntu
从Linux到Windows:阿里云服务器系统镜像适配场景与选择参考
阿里云为用户提供了丰富多样的服务器操作系统选择,以满足不同场景下的应用需求。目前,云服务器的操作系统镜像主要分为公共镜像、自定义镜像、共享镜像、镜像市场和社区镜像五大类。以下是对这些镜像类型的详细介绍及选择云服务器系统时需要考虑的因素,以供参考。
|
5月前
|
Ubuntu Linux 网络安全
在Linux云服务器上限制特定IP进行SSH远程连接的设置
温馨提示,修改iptables规则时要格外小心,否则可能导致无法远程访问你的服务器。最好在掌握足够技术知识和理解清楚操作含义之后再进行。另外,在已经配置了防火墙的情况下,例如ufw(Ubuntu Firewall)或firewalld,需要按照相应的防火墙的规则来设置。
204 24
|
4月前
|
Linux
Linux下版本控制器(SVN) -服务器端环境搭建步骤
Linux下版本控制器(SVN) -服务器端环境搭建步骤
209 0
Linux下版本控制器(SVN) -服务器端环境搭建步骤
|
5月前
|
数据挖掘 Linux 数据库
服务器数据恢复—Linux系统服务器数据恢复案例
服务器数据恢复环境: linux操作系统服务器中有一组由4块SAS接口硬盘组建的raid5阵列。 服务器故障: 服务器工作过程中突然崩溃。管理员将服务器操作系统进行了重装。 用户方需要恢复服务器中的数据库、办公文档、代码文件等。