网站建设背景介绍怎么写,凯里网站设计,网络推广营销技巧,wordpress插件 微信iSCSI简介(Internet SCSI)#xff1a; iSCSI 小型计算机系统接口#xff0c;IBM公司研发#xff0c;用于在IP网络上运行SCSI协议#xff1b;解决了 SCSI需要直连存储设备的局限性#xff1b;可以不停机扩展存储容量#xff0c;iSCSI 将 SCSI 接口与 Ethernet 技术结合 iSCSI 小型计算机系统接口IBM公司研发用于在IP网络上运行SCSI协议解决了 SCSI需要直连存储设备的局限性可以不停机扩展存储容量iSCSI 将 SCSI 接口与 Ethernet 技术结合使服务器可与使用 IP 网络的存储装置互相交换数据基于 TCP/IP 协议创建 SAN以数据块级别在多个数据存储网络间进行传输 iSCSI 主要功能 在 TCP/IP 网络上的主机系统initiator 启动器和存储设备target 目标器之间进行数据的封装和可靠传输。iSCSI 启动器是客户端设备启动器可以由软件或硬件实现 ·软件iscsi-initiator-utilsRPM 免费提供的 Linux-Open-iSCSI 驱动 ·硬件iSCSI HBA或 TCP 卸载引擎[TOE] 卡 - 本质使一个专用以太网卡 其上的 SCSI ASIC 可以从系统CPU内卸载所有工作TCP 和 SCSI 命令iSCSI 目标是 iSCSI 网络的“服务器”组件。通常为一个存储设备 环境准备 两台RHEL虚拟机拍初始化快照 node1192.168.22.77target端 iSCSI服务端 client1192.168.22.107initiator端 iSCSI客户端一、iSCSI配置 target端分区 [rootlocalhost ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 40G 0 disk
├─sda1 8:1 0 512M 0 part /boot
└─sda2 8:2 0 25.5G 0 part ├─rhel-swap 253:0 0 512M 0 lvm [SWAP]└─rhel-root 253:1 0 25G 0 lvm /
sr0 11:0 1 3.6G 0 rom /mnt/cdrom
[rootlocalhost ~]# fdisk /dev/sda
Welcome to fdisk (util-linux 2.23.2).Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.Command (m for help): pDisk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009ed86Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1050623 524288 83 Linux
/dev/sda2 1050624 54544383 26746880 8e Linux LVMCommand (m for help): n
Partition type:p primary (2 primary, 0 extended, 2 free)e extended
Select (default p):
Using default response p
Partition number (3,4, default 3):
First sector (54544384-83886079, default 54544384):
Using default value 54544384
Last sector, sectors or size{K,M,G} (54544384-83886079, default 83886079): 5G
Partition 3 of type Linux and of size 5 GiB is setCommand (m for help): pDisk /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 sectors
Units sectors of 1 * 512 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009ed86Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1050623 524288 83 Linux
/dev/sda2 1050624 54544383 26746880 8e Linux LVM
/dev/sda3 54544384 65030143 5242880 83 LinuxCommand (m for help): w
The partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[rootlocalhost ~]# partprobe /dev/sda [rootlocalhost ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 40G 0 disk ├─sda1 8:1 0 512M 0 part /boot ├─sda2 8:2 0 25.5G 0 part │ ├─rhel-swap 253:0 0 512M 0 lvm [SWAP] │ └─rhel-root 253:1 0 25G 0 lvm / └─sda3 8:3 0 5G 0 part sr0 11:0 1 3.6G 0 rom /mnt/cdrom 配置yum仓库all vim /etc/yum.repos.d/a.repo
[a]
namea
baseurlfile:///mnt/cdrom
enabled1
gpgcheck0 [rootlocalhost ~]# mkdir /mnt/cdrom
[rootlocalhost ~]# mount /dev/sr0 /mnt/cdrom
mount: /dev/sr0 is write-protected, mounting read-only
[rootlocalhost ~]#
[rootlocalhost ~]#
[rootlocalhost ~]# yum repolist
Loaded plugins: langpacks, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
a | 4.1 kB 00:00:00
(1/2): a/group_gz | 134 kB 00:00:00
(2/2): a/primary_db | 3.4 MB 00:00:00
repo id repo name status
a a 4,371
repolist: 4,371 关闭防火墙及selinuxall [rootlocalhost ~]# systemctl stop firewalld
[rootlocalhost ~]# systemctl disable firewalld
rm /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service
rm /etc/systemd/system/basic.target.wants/firewalld.service
[rootlocalhost ~]# setenforce 0 target端配置 1.安装targetcli [rootnode1 ~]# yum -y install targetcli 2. 运行targetcli [rootlocalhost ~]# targetcli 2.1 创建后端存储 / backstores/block create namensd dev/dev/sda3 2.2 创建target / iscsi/ create iqn.2019-06.vip.kklinux:node1 注意IQN 的格式为iqn.年份-月份.反向域名:自定义标识 如iqn.2019-06.vip.kklinux:node1;其中的字母均应为小写即使输入时包含大写命令执行后系统会自动转换成小写。 2.3 创建lun逻辑单元 /iscsi cd /iscsi/iqn.2019-06.vip.kklinux:node1/tpg1/luns /iscsi/iqn.20...de1/tpg1/luns create /backstores/block/nsd 2.4 配置acl访问控制设置访问服务时客户端声称的名字 /iscsi cd /iscsi/iqn.2019-06.vip.kklinux:node1/tpg1/acls/iscsi/iqn.20...de1/tpg1/aclscreate iqn.2019-06.vip.kklinux:client1 //客户端配置的名称应与上面一致 如果需要配置用户和密码 cd /iscsi/iqn.2019-06.vip.kklinux:node1/tpg1/acls/iqn.2019-06.vip.kklinux:client1
/iscsi/iqn.20...kklinux:client1 set auth useridusername
/iscsi/iqn.20...kklinux:client1 set auth passwordpassword 2.5 退出 /iscsi/iqn.20...de1/tpg1/acls exit 3. 重启target服务并设置开机自启 systemctl restart target
systemctl enable target initiator端配置 1. 装包iscsi-initiator-utils [rootclient1 ~]# yum install -y iscsi-initiator-utils 2. 修改配置文件 [rootclient1 ~]# vi /etc/iscsi/initiatorname.iscsi
InitiatorNameiqn.2019-06.vip.kklinux:client1 //名称应与服务端acl配置的名称一致 如果target端配置了用户和密码还需添加 node.session.auth.authmethod CHAP
node.session.auth.username username
node.session.auth.password password 3. 重启服务 iscsid [rootclient1 ~]# systemctl restart iscsid //更新IQN标识。注意是iscsid 4. 发现服务端IQN [rootclient1~]# iscsiadm -m discovery -t st -p 192.168.22.77 192.168.22.77:3260,1 iqn.2019-06.vip.kklinux:node1 5. 识别服务端共享 [rootclient1 ~]# systemctl restart iscsi
[rootclient1 ~]# systemctl enable iscsi
[rootclient1 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 60G 0 disk
├─sda1 8:1 0 2M 0 part
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 34G 0 part ├─rhel-root 253:0 0 30G 0 lvm /└─rhel-swap 253:1 0 4G 0 lvm [SWAP]
sdb 8:16 0 5G 0 disk
sr0 11:0 1 3.5G 0 rom /mnt/cdrom 转载于:https://www.cnblogs.com/kunges/p/iscsi_disk.html