debian系统下iscsi有关配置和使用
1.apt-get install open-iscsi //安装成功后才能获取initiatorname
2.apt-get install multipath-tools //安装multipath
3.vi /etc/multipath.conf //配置多路径文件
# cat /etc/multipath.conf
defaults {
user_friendly_names yes
path_grouping_policy multibus
failback immediate
no_path_retry fail
}
devices {
device {
vendor "ET"
product "ET_GDS"
hardware_handler "1 alua"
path_grouping_policy "failover"
path_selector "queue-length 0"
failback immediate
path_checker tur
prio alua
prio_args exclusive_pref_bit
fast_io_fail_tmo 25
no_path_retry queue
}
}
4./etc/init.d/open-iscsi restart //安装完之后重启open-iscsi服务
5.systemctl restart iscsid
systemctl restart multipathd //重启相关服务
6.iscsiadm -m discovery -t st -p 192.168.1.3 //就是搜索192.168.1.3:3260 上提供的iscsi挂载点,如果搜索到反馈形式为(例如):
192.168.1.3:3260,1 iqn.1986-03.com.ibm:1145.cluster192.168.1.1.node2
192.168.1.5:3260,1 iqn.1986-03.com.ibm:1145.cluster192.168.1.1.node2
7. iscsiadm -m node -T iqn.1986-03.com.ibm:1145.cluster192.168.1.1.node2 -l //登录iscsi客户端
8.fdisk -l或者multipath -ll 列出挂载的卷,形式为/dev/dm-X 或者 /dev/mapper/mpathX
9. iscsiadm -m node -T iqn.1986-03.com.ibm:1145.cluster192.168.1.1.node2 --logout //退出登录
10.手动挂载 : parted /dev/mapper/mpathX 之后执行mount -a