配置使用iscsi
正文
配置使用iscsi
图解:
请确保服务器A上已经关闭了防火墙或者允许了3260端口。下图描述了使用iSCSI的大致过程,后文内容虽然因为介绍各种用法而显得比较杂,但根据这张图的流程,阅读时很容易搞清楚相关内容。
gtadm是一个高度模式化的命令,他们的模式很相近。有三个模式:target、logicalunit、account。指定模式时使用--mode选项。再使用--op来指定对应模式下的选项。另外,使用-lld指定driver,有两种driver:iscsi和iser,基本都会使用iscsi。
tgtadm --help
--lld <driver> --mode target --op new --tid <id> --targetname <name>
add a new target with <id> and <name>. <id>
must not be zero.
--lld <driver> --mode target --op delete [--force] --tid <id>
delete the specific target with <id>.
With force option, the specific target is
deleted even if there is an activity.
--lld <driver> --mode target --op show
show all the targets.
--lld <driver> --mode target --op show --tid <id>
show the specific target's parameters.
--lld <driver> --mode target --op update --tid <id> --name <param> --value <value>
change the target parameters of the specific target with <id>.
--lld <driver> --mode target --op bind --tid <id> --initiator-address <address>
--lld <driver> --mode target --op bind --tid <id> --initiator-name <name>
enable the target to accept the specific initiators.
--lld <driver> --mode target --op unbind --tid <id> --initiator-address <address>
--lld <driver> --mode target --op unbind --tid <id> --initiator-name <name>
disable the specific permitted initiators.
--lld <driver> --mode logicalunit --op new --tid <id> --lun <lun> --backing-store <path> --bstype <type> --bsoflags <options>
add a new logical unit with <lun> to the specific
target with <id>. The logical unit is offered
to the initiators. <path> must be block device files
(including LVM and RAID devices) or regular files.
bstype option is optional.
bsoflags supported options are sync and direct
(sync:direct for both).
--lld <driver> --mode logicalunit --op delete --tid <id> --lun <lun>
delete the specific logical unit with <lun> that the target with <id> has.
--lld <driver> --mode account --op new --user <name> --password <pass>
add a new account with <name> and <pass>.
--lld <driver> --mode account --op delete --user <name>
delete the specific account having <name>.
--lld <driver> --mode account --op bind --tid <id> --user <name> [--outgoing]
add the specific account having <name> to
the specific target with <id>.
<user> could be <IncomingUser> or <OutgoingUser>.
If you use --outgoing option, the account will be
added as an outgoing account.
--lld <driver> --mode account --op unbind --tid <id> --user <name>
delete the specific account having <name> from specific target.
--control-port <port> use control port <port>
上表中的选项都是长格式的,但他们都有对应的短格式选项。
tgt-admin是读取配置文件的选项然后调用tgtadm来执行的工具。它的选项很多可以简化tgtadm命令的书写,毕竟tgtadm的选项太长太多余了,除此之外也有一些其他的作用用于更细致的配(tgtadm配置的太粗糙了)。用法如下:
参考资料
分类:
【13】ceph块存储
标签:
【ceph块存储】
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
2021-06-28 【C++编程】 std::detach()用法
2018-06-28 【存储器管理】程序的装入和链接