openfile
已经不维护了,实际使用下来踩了很多坑,确实也不太好用,还是建议采用targetcli来创建iscsi共享存储。
openfiler
镜像下载
下载地址:
官方下载地址
有一说一下载是真的慢,镜像上传到百度网盘了,自取哈。
百度网盘
iscsi客户端挂载iscsi磁盘后只读
size=25G features='0' hwhandler='0' wp=ro
`-+- policy='round-robin 0' prio=1 status=active
`- 15:0:0:0 sdj 8:144 active ready running
- 没有配置acl认证,或者是acl认证失败。
- 采用tpg的认证方式。
查看iscsi客户端与服务端tcp连接对应的IP和端口
# 找到外置存储对应的块设备信息
$ mutilpath -ll
17:0:0:13 sdl 8:176 active ready running
# 查看设备对应的设备信息
> https://blog.csdn.net/jiaping0424/article/details/51587113
$ udevadm info -q path -n /dev/sdm
/devices/platform/host18/session3/target18:0:0/18:0:0:18/block/sdm
# 查看对应的端口
$ cat /sys/devices/platform/host16/session1/connection1:0/iscsi_connection/connection1:0/local_port
# 要查看各个IP访问到的存储信息
$ iscsiadm -m session -P 3
- 新建虚拟机
- 内核版本选择2.6.x
- 指定vm镜像存放的位置。
- 大小建议超过8G,就不用配置各种分区大小,省去很多麻烦。
- 网络选择桥接模式,内存和处理器根据需求配置就可以了。
- 系统盘使用推荐8G大小,上边这步要报错,为了避免繁琐的分区配置,磁盘扩展是一个比较好的选择。
- 设置后台登录密码。
默认的用户名密码进行登陆:
User:openfiler
Pass:password
- 添加新磁盘,用于创建iscsi存储,一定要选择iscsi磁盘类型。
- 添加硬盘作为iscsi存储磁盘。
从安装的结果来看,该镜像使用的红帽的内核,内核版本还是2.6.32。
谷歌浏览器和edg浏览器都无法登陆,只能用火狐浏览器!!!
火狐浏览器解决无法访问Web gui问题
- 创建物理卷。
- 创建卷组。
- 创建逻辑卷。
- 配置网卡信息,用于iscsi存储访问,以下配置了两条iscsi访问路径。
- 开启iscsi服务器。
- 创建target iqn。
- map lun。
- 设置访问权限为allow。
curtis@curtis-PC:~/Desktop$ sudo apt-get install open-iscsi
# 发现iscsi外置存储
curtis@curtis-PC:~/Desktop$ sudo iscsiadm -m discovery -t st -p 192.168.0.101
请输入密码:
验证成功
192.168.0.101:3260,1 iqn.2006-01.com.openfiler:tsn.22f2c701e1e7
192.168.0.103:3260,1 iqn.2006-01.com.openfiler:tsn.22f2c701e1e7
curtis@curtis-PC:~/Desktop$ sudo iscsiadm --mode discovery --type sendtargets --portal 192.168.0.101
192.168.0.101:3260,1 iqn.2006-01.com.openfiler:tsn.22f2c701e1e7
192.168.0.103:3260,1 iqn.2006-01.com.openfiler:tsn.22f2c701e1e7
curtis@curtis-PC:~/Desktop$ sudo fdisk -l
Disk /dev/sda: 512 GiB, 549755813888 bytes, 1073741824 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcca4a166
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 3147775 3145728 1.5G 83 Linux
/dev/sda2 3147776 1010827263 1007679488 480.5G 5 Extended
/dev/sda3 1010827264 1050673151 39845888 19G 83 Linux
/dev/sda4 1050673152 1073739775 23066624 11G 82 Linux swap / Solaris
/dev/sda5 3149824 128976895 125827072 60G 83 Linux
/dev/sda6 128978944 254806015 125827072 60G 83 Linux
/dev/sda7 254808064 1010827263 756019200 360.5G 83 Linux
Partition table entries are not in disk order.
# login
curtis@curtis-PC:~/Desktop$ sudo iscsiadm --mode node --targetname iqn.2006-01.com.openfiler:tsn.63824004e327 –portal 192.168.0.101:3260 --login
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.63824004e327, portal: 192.168.0.103,3260] (multiple)
Logging in to [iface: default, target: iqn.2006-01.com.openfiler:tsn.63824004e327, portal: 192.168.0.101,3260] (multiple)
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.63824004e327, portal: 192.168.0.103,3260] successful.
Login to [iface: default, target: iqn.2006-01.com.openfiler:tsn.63824004e327, portal: 192.168.0.101,3260] successful.
curtis@curtis-PC:~/Desktop$ sudo iscsiadm -m session
tcp: [1] 192.168.0.101:3260,1 iqn.2006-01.com.openfiler:tsn.63824004e327 (non-flash)
tcp: [2] 192.168.0.103:3260,1 iqn.2006-01.com.openfiler:tsn.63824004e327 (non-flash)
# 查看磁盘
curtis@curtis-PC:~/Desktop$ sudo fdisk -l
Disk /dev/sda: 512 GiB, 549755813888 bytes, 1073741824 sectors
Disk model: VMware Virtual S
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xcca4a166
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 3147775 3145728 1.5G 83 Linux
/dev/sda2 3147776 1010827263 1007679488 480.5G 5 Extended
/dev/sda3 1010827264 1050673151 39845888 19G 83 Linux
/dev/sda4 1050673152 1073739775 23066624 11G 82 Linux swap / Solaris
/dev/sda5 3149824 128976895 125827072 60G 83 Linux
/dev/sda6 128978944 254806015 125827072 60G 83 Linux
/dev/sda7 254808064 1010827263 756019200 360.5G 83 Linux
Partition table entries are not in disk order.
Disk /dev/sdb: 9.53 GiB, 10234101760 bytes, 19988480 sectors
Disk model: VIRTUAL-DISK
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 /dev/sdc: 9.53 GiB, 10234101760 bytes, 19988480 sectors
Disk model: VIRTUAL-DISK
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
# 可以正常对挂载的设备进行读写
curtis@curtis-PC:~/Desktop$ sudo dd if=/dev/sda of=/dev/sdb bs=1M count=10 oflag=direct
记录了10+0 的读入
记录了10+0 的写出
10485760 bytes (10 MB, 10 MiB) copied, 0.20493 s, 51.2 MB/s
openfiler删除iscsi target iqn
opnefiler 安装方法
iscsi target 认证失败解决
iscsi挂载的盘只读
iscsiadm常用命令
搭建iscis环境:
https://blog.csdn.net/liuchuang11/article/details/90175693
https://blog.csdn.net/weixin_42506599/article/details/102742662
多路径:
https://www.cnblogs.com/lijiaman/p/13854674.html
https://www.cnblogs.com/lijiaman/p/13893346.html