1.定义

    iSCSI(Internet SCSI)支持从客户端(发起端)通过IP向远程服务器上的SCSI存储设备(目标)发送SCSI命令。iSCSI限定名称用于确定发起端和目标,并采用iqn.yyyy-mm.{reverse domain}:label的格式。默认情况下,网络通信是至iSCSI目标上的端口3260/tcp的明文。

    iSCSI发起端:需要访问原始SAN存储的客户端。

    iSCSI目标:从iSCSI服务器提供的远程硬盘磁盘,或“目标门户”

    iSCSI目标门户:通过网络向发起端提供目标的服务器。

    IQN:“iSCSI限定名称”。每个发起端和目标需要唯一名称进行标识,最好的做法是使用一个在Internet上可能独一无二的名称。

 

2.启动iSCSI共享设备

##在server上##

建立一个lvm设备:

fdisk /dev/vdb

n--+1000M--t--8e--p--wq


partprobe

pvcreate /dev/vdb1

vgcreate vg0 /dev/vdb1

lvcreate -l 249 -n iscsi_storage vg0

lvs

 

yum install targetcli -y ##安装iSCSI目标软件包


systemctl enable target ##启动服务

systemctl stop firewalld ##关闭火墙

 

targetcli ##进入iSCSI目标交互式配置模式

targetcli shell version 2.1.fb34

Copyright 2011-2013 by Datera, Inc and others.

For help on commands, type 'help'.

/> ls

/> /backstores/block create server1storage /dev/vg0/iscsi_storage

Created block storage object server1storage using /dev/vg0/iscsi_storage.

/> /iscsi create iqn.2017-06.com.example:strage1

Created target iqn.2017-06.com.example:strage1.

Created TPG 1.

/> /iscsi/iqn.2017-06.com.example:strage1/tpg1/luns create /backstores/block/server1storage

Created LUN 0.

/> /iscsi/iqn.2017-06.com.example:strage1/tpg1/acls create iqn.2017-06.com.example:server1storagekey

Created Node ACL for iqn.2017-06.com.example:server1storagekey

Created mapped LUN 0.

/> /iscsi/iqn.2017-06.com.example:strage1/tpg1/portals  create 172.25.31.11

Using default IP port 3260

Created network portal 172.25.31.11:3260.

/> exit

Global pref auto_save_on_exit=true

Last 10 configs saved in /etc/target/backup.

Configuration saved to /etc/target/saveconfig.json

 


##在desktop上##

vim /etc/iscsi/initiatorname.iscsi

InitiatorName=iqn.2017-06.com.example:server1storagekey ##设置发起端的IQN


systemctl restart iscsi ##重启服务


iscsiadm -m discovery -t st -p 172.25.31.11 ##查找iSCSI服务器所提供的iSCSI目标(目标门户)

172.25.31.11:3260,1 iqn.2017-06.com.example:strage1

iscsiadm -m node -T iqn.2017-06.com.example:strage1 -p 172.25.31.11 -l ##登录服务器上的一个或多个iscsi目标

Logging in to [iface: default, target: iqn.2017-06.com.example:strage1, portal: 172.25.31.11,3260] (multiple)

Login to [iface: default, target: iqn.2017-06.com.example:strage1, portal: 172.25.31.11,3260] successful.


    此时,可以使用iSCSI磁盘,就好像它是本地连接硬盘驱动器。可以挂载现有文件系统。如果磁盘未格式化,可以通过fdisk进行分区,例如,通过文件系统格式化分区或作为LVM物理卷。

fdisk /dev/sda

n--wq

partprobe


mkfs.xfs /dev/sda1

mount /dev/sda1 /mnt/


yum install tree -y


tree -C /var/lib/iscsi/


 

3.挂载

在desktop

blkid ##查看UUID(每次引导时显示的设备名称都不同,如果按设备名称挂载,这会导致使用错误的设备。)

/dev/sda1: UUID="24875c42-c94c-4f52-8ac9-452df9417264" TYPE="xfs"

vim /etc/fstab ##开机自挂起(_netdev作为挂载选项,启用联网)

UUID="24875c42-c94c-4f52-8ac9-452df9417264"     /mnt    xfs     defaults,_netdev        0 0


 


4.删除

umount /mnt ##卸载

vim /etc/fstab ##删除开机自启

iscsiadm -m node -T iqn.2017-06.com.example:strage1 -p 172.25.31.11 -u ##登出iSCSI目标,以暂时断开连接

iscsiadm -m node -T iqn.2017-06.com.example:strage1 -p 172.25.31.11 -o delete ##删除iSCSI目标的本地记录,以永久断开连接

 

在server

targetcli

/> clearconfig confirm=True ##清除iSCSI的所有配置信息

All configuration cleared

 

Linux--RH254---unit 5 ISCSI相关推荐

  1. Linux上配置使用iSCSI详细说明

    本文详细介绍iSCSI相关的内容,以及在Linux上如何实现iSCSI. 第1章 iSCSI简介 1.1 scsi和iscsi 传统的SCSI技术是存储设备最基本的标准协议,但通常需要设备互相靠近并用 ...

  2. linux 多路径重启,(linux多路径连接iScsi存储重启自动连接.docx

    (linux多路径连接iScsi存储重启自动连接 RHEL系统带有iSCSI initiator软件,下面描述如何配置iSCSI Initiator实现对ISCSI卷的访问Linux iscsi 介绍 ...

  3. Redhat linux AS4 环境下iSCSI协议配置

    Redhat linux AS4 环境下iSCSI协议配置<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:offi ...

  4. linux怎么共享存储,什么是ISCSI,及Linux下怎么样通过ISCSI实现共享存储

    什么是ISCSI iSCSI(iSCSI = internet Small Computer System Interface )小型计算机接口.是由IEETF开发的网络存储标准,目的是为了用IP协议 ...

  5. 储存区域网路(SAN)-使用Linux(Centos5)来做iSCSI Target 篇

    转载本站文章请注明,转载自: 扶凯[ http://www.php-oa.com] 储存区域网路(SAN) 谈到iSCSI就会先谈到储存区域网路(Storage Area Network, 简称 SA ...

  6. 最新linux搭建gfs系统--iscsi+GFS实现网络存储

    虚拟机搭建gfs系统 系统环境:CentOS release 5.5 - 2.6.18-194.el5 gfs节点1:192.168.1.231 gfs1 gfs节点2:192.168.1.232 g ...

  7. linux查询iscsi服务,使用Linux的tgtd提供iscsi服务

    8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? 文章目录 安装部署IP角色192.168.182.156tgtd 192.168.182.157client1 192. ...

  8. Linux system NFS、iSCSI

    nfs网络文件系统 1.服务端 yum install nfs-utils -y systemctl start nfs 添加相关服务 firewall-cmd --permanent --add-s ...

  9. linux外接NetApp存储,实战RH Linux下配置百兆网卡iSCSI 访问NetApp

    曾经在Red Hat Enterprise Linux 3 下配置百兆网卡利用 ISCSI 访问 NetApp. 感觉还是比较方便.性能倒没有多留意. 实战系统版本: [root@trade /]# ...

  10. Linux学习 Unit 4

    unit4  1.管理输入输出  在linux系统中,正确输出的编号为1,错误输出编号为2 在系统中用普通用户执行 "student" find /etc -name passwd ...

最新文章

  1. 是时候装逼了,试试 IDEA 解决 Maven 依赖冲突的高能神器!
  2. C++ sort()函数的cmp含义
  3. 2022速卖通328大促活动招商规则出炉啦,热销高潜产品抢先看
  4. C语言学习之编程序,用getchar函数读入两个字符给cl和c2,然后分别用putchar函数和printf函数输出这两个字符
  5. Nvidia GPU如何在Kubernetes 里工作
  6. 整天说Code Review重要,你知道应该关注哪些关键点吗?
  7. c语言float类型小数部分占几个字节,c语言float类型小数点后位数
  8. python qt教程视频 下载_Qt基础课程视频教程 教学视频 百度网盘下载
  9. Zigbee和WiFi的信道重叠
  10. 利用模式进行构建第九讲——树形模式
  11. Fuse内核死锁导致的Android系统死机问题分析
  12. 计算机各类会议及投稿文章总结(快速入门)
  13. 八成家用智能摄像头存泄密风险 破解后可窃取实时画面
  14. ESP32学习笔记(18)——光强度GY-30(BH1750)使用
  15. 刷机:酷比魔方iwork8 刷回双系统
  16. 微信调试--微信内置浏览器为什么对pharser.js支持这么差???
  17. RK3399教程:linux clk使用
  18. 核心单词Word List 40
  19. 转载:网站分析与SEO效果的评估
  20. C语言三方库的调用和编写

热门文章

  1. php如何写短信验证码,php发送短信验证码
  2. VulkanLearning - 环境搭建:使用CLion+cmake链接第三方库
  3. JS常用方法模板(更新中)
  4. 泽泽在巴西(jzoj普及组模拟第三题)(超难)
  5. php使用curl请求时,以x-www-form-urlencoded 方式发送遇到的问题
  6. wxPython界面开发总结
  7. 移动端支付界面制作(小兔鲜项目)
  8. 警惕热门技术陷阱,数据库与存储技术规划如何制定?
  9. linux 中的 zcat 操作压缩包的命令
  10. CDH大数据平台搭建之KAFKA集群搭建