iscsi使用教程(下)
动态创建目标
安装iscsi服务端
# yum install -y scsi-target-utils.x86_64
修改配置文件
# mkdir -p ~/volumes
# sed -i '$ i include /root/volumes/*' /etc/tgt/tgtd.conf
启动服务
### 有告警是正常的,因为我们现在还没配置目标
# tgtd -f --iscsi portal=92.0.0.14:3260
tgtd: iser_ib_init(3436) Failed to initialize RDMA; load kernel modules?
tgtd: work_timer_start(146) use timer_fd based scheduler
tgtd: bs_init_signalfd(267) could not open backing-store module directory /usr/lib64/tgt/backing-store
tgtd: bs_init(386) use signalfd notification
新增磁盘并创建LV
# pvcreate /dev/sda
# vgcreate cinder-volumes /dev/sda
# lvcreate -n vol cinder-volumes -L 1g
创建目标配置文件
# tee /root/volumes/vol.conf << EOF
<target iqn.2010-10.org.openstack:vol>
backing-store /dev/cinder-volumes/vol
driver iscsi
write-cache on
</target>
EOF
动态更新目标
# tgt-admin --update iqn.2010-10.org.openstack:vol
查询目标信息
# tgtadm --lld iscsi --op show --mode target
Target 1: iqn.2010-10.org.openstack:vol
System information:
Driver: iscsi
State: ready
I_T nexus information:
LUN information:
LUN: 0
Type: controller
SCSI ID: IET 00010000
SCSI SN: beaf10
Size: 0 MB, Block size: 1
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
SWP: No
Thin-provisioning: No
Backing store type: null
Backing store path: None
Backing store flags:
LUN: 1
Type: disk
SCSI ID: IET 00010001
SCSI SN: beaf11
Size: 1074 MB, Block size: 512
Online: Yes
Removable media: No
Prevent removal: No
Readonly: No
SWP: No
Thin-provisioning: No
Backing store type: rdwr
Backing store path: /dev/cinder-volumes/vol
Backing store flags:
### 允许连接的客户端用户名
Account information:
### 允许连接的客户端地址
ACL information:
ALL
安装客户端
# yum install iscsi-initiator-utils.x86_64 -y
发现目标
# iscsiadm -m discovery -t sendtargets -p 92.0.0.14
92.0.0.14:3260,1 iqn.2010-10.org.openstack:vol
连接目标
# iscsiadm -m node -T iqn.2010-10.org.openstack:vol -p 92.0.0.14 -l
Logging in to [iface: default, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260] (multiple)
Login to [iface: default, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260] successful.
# iscsiadm -m session
tcp: [1] 92.0.0.14:3260,1 iqn.2010-10.org.openstack:vol (non-flash)
断开连接
# iscsiadm -m node -T iqn.2010-10.org.openstack:vol -p 92.0.0.14 -u
Logging out of session [sid: 2, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260]
Logout of [sid: 2, target: iqn.2010-10.org.openstack:vol, portal: 92.0.0.14,3260] successful.
# iscsiadm -m session
iscsiadm: No active sessions.
iscsi使用教程(下)的更多相关文章
- iSCSI 在Linux下的模拟实验
5.iSCSI客户端(Initiator)配置 在Linux 2.6内核中提供了iscsi驱动,iSCSI 驱动(driver)使主机拥有了通过IP网络访问存储 的能力,驱动在主机(Initiat ...
- Web前端-JavaScript基础教程下
Web前端-JavaScript基础教程下 <script>有6个属性: async对外部脚本有效,可以用来异步操作,下载东西,不妨碍其他操作. charset为src属性指定字符集. d ...
- django入门教程(下)
在两篇文章帮你入门Django(上)一文中,我们已经做了一个简单的小网站,实现了保存用户数据到数据库,以及从后台数据库读取数据显示到网页上这两个功能. 看上去没有什么问题了,不过我们可以让它变得更加完 ...
- React Native之React速学教程(下)
概述 本篇为<React Native之React速学教程>的最后一篇.本篇将带着大家一起认识ES6,学习在开发中常用的一些ES6的新特性,以及ES6与ES5的区别,解决大家在学习Reac ...
- iscsi使用教程(中)
服务端管理命令 ### tgtadm 是一个模式化的命令,其使用格式如下: # tgtadm --lld [driver] --op [operation] --mode [mode] [OPTION ...
- jenkins 入门教程(下)
接上回继续学习jenkins,这次主要来看一些疑难杂症: 一.yum install安装方式 除了直接java -jar jenkins.war方式,还可以用yum安装,这种方式下提供了更多的可配置选 ...
- KMP算法完整教程 (下)
下面我们用数学归纳法来解决这个填值的问题. 这里我们借鉴数学归纳法的三个步骤(或者说是动态规划?): 1.初始状态 2.假设第j位以及第j位之前的我们都填完了 3.推论第j+1位该怎么填 初始状态我们 ...
- iscsi使用教程(上)
服务端 服务器环境 已经安装过qemu-img的32位ubuntu $ uname -a Linux ubuntu-virtual-machine 3.13.0-46-generic #76-Ubun ...
- iscsi使用教程
服务端 服务器环境 已经安装过qemu-img的32位ubuntu $ uname -a Linux ubuntu-virtual-machine 3.13.0-46-generic #76-Ubun ...
随机推荐
- JS命令模式个人理解
JS命令模式个人理解 //BODY部分<body> <button id="execute">打开电视</button> <button ...
- MVC中URL传多个参数
1.mvc中url传递多个参数不能直接使用&,会报错(从客户端(&)中检测到有潜在危险的 Request.Path 值) 方法①:使用?---/Home/Index/?id=xxx&a ...
- BEC listen and translation exercise 37
You're supposed to do that before 10.30 in the morning, but obviously, if it's an emergency, you can ...
- QWidget、QMainWindow、QFrame、QWindow、QDialog、QScrollArea区别
QWidget是所有可视化控件的基类,可以直接渲染出一个窗口来. QMainWindow用来表示一个主窗口,这个主窗口可以设置菜单和工具栏 QFrame用来表示一个框架,用来当作容器,因为可以设置它的 ...
- leetcode 258. Add Digits(数论)
Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. ...
- linux命令学习笔记(21):find命令之xargs
xargs是一条Unix和类Unix操作系统的常用命令.它的作用是将参数列表转换成小块分段传递给其他命令,以避免参数列表过长的问题 xargs的作用一般等同于大多数Unix shell中的反引号,但更 ...
- MarkDown不支持图片放缩。。

题目传送门:https://www.luogu.org/problemnew/show/P1601 高精度加法板子.我们灵性地回忆一波小学学加法列竖式的场景(从\(6\)岁开始口算从未打过草稿的大佬请 ...