规划:
target(server)
server:192.168.1.254
initiator(client)
rs1.china-kody.com 192.168.1.215
rs2.china-kody.com 192.168.1.216
rs3.china-kody.com 192.168.1.217
使用的软件包:
server: scsi-target-utils
client:iscsi-initiator-utils ricci luci gfs2-utils lvm2-cluster
配置server:
编辑: /etc/tgt/targets.conf
<target iqn.2015-01.com.china-kody:server.target1> backing-store /dev/sdb1 incominguser iscsiuser iscsiuser initiator-address 192.168.1.0/24 </target>
配置client(rs1,rs2,rs3类似)
一、编辑:/etc/iscsi/initiatorname.iscsi
initiatorName=iqn.2015-01.com.china-kody:5e3a51d2b43
二、编辑/etc/iscsi/initiatorname.iscsi
node.session.auth.authmethod = CHAP node.session.auth.username = iscsiuser node.session.auth.password = iscsiuser
三、测试iscsi连接
[root@rs1 iscsi]# iscsiadm -m discovery -t st -p 192.168.1.254 正在启动 iscsid: [确定] 192.168.1.254:3260,1 iqn.2015-01.com.china-kody:server.target1 [root@rs1 iscsi]# iscsiadm -m node -T iqn.2015-01.com.china-kody:server.target1 -p 192.168.1.254 -l Logging in to [iface: default, target: iqn.2015-01.com.china-kody:server.target1, portal: 192.168.1.254,3260] (multiple) Login to [iface: default, target: iqn.2015-01.com.china-kody:server.target1, portal: 192.168.1.254,3260] successful.
四、配置主机名,以及hosts文件(这里自行修改)
五、使用luci配置集群cluster_web
洋、配置lvm为集群文件系统
[root@rs1 ~]# lvmconf --enable-cluster [root@rs1 ~]# chkconfig clvmd on [root@rs1 ~]# service clvmd start [root@rs1 mnt]# vgcreate /dev/sdc [root@rs1 mnt]# lvcreate -n lv_cluster -L 20G vg_cluster
七、配置gfs2
mkfs.gfs2 -j 3 -p lock_dlm -t cluster_web:cluster /dev/mapper/vg_cluster-lv_cluster [root@rs1 /]# mount /dev/mapper/vg_cluster-lv_cluster /mnt
测试正常
原文地址:http://5127276.blog.51cto.com/5117276/1600763