利用Redhat Rhcs套件搭建高可用性群集,賓實現iscsi網路儲存!
拓補圖如下:
targetServer安裝軟體[root@localhost ~]# yum -y install scsi-target-utils
開啟服務[root@localhost ~]# service tgtd start[root@localhost ~]#chkconfig tgtd on
添加磁碟分割[root@localhost ~]# fdisk /dev/sdb
建立共用磁碟[root@localhost ~]#tgtadm --lld iscsi --op new --mode target --tid 1 --targetname iqn.2011-21.com.a.target:disk[root@localhost ~]#tgtadm --lld iscsi --op new --mode=logicalunit --tid=1 --lun=1 --backing-store /dev/sdbtgtadm --lld iscsi --op bind --mode=target --tid=1 --initiator-address=192.168.100.0/24
開機自啟動[root@localhost ~]# vim /etc/rc.d/rc.localtgtadm --lld iscsi --op new --mode target --tid 1 --targetname iqn.2011-21.com.a.target:disktgtadm --lld iscsi --op new --mode=logicalunit --tid=1 --lun=1 --backing-store /dev/sdbtgtadm --lld iscsi --op bind --mode=target --tid=1 --initiator-address=192.168.100.0/24
initiator1安裝軟體[root@node1 ~]# yum -y install iscsi-initiator-utils
開啟服務[root@node1 ~]# service iscsi start[root@node1 ~]#chkconfig iscsi on
登陸磁碟[root@node1 ~]#iscsiadm --mode discovery --type sendtargets --portal 192.168.100.30[root@node1 ~]# iscsiadm --mode node --targetname iqn.2011-21.com.a.target:disk --portal 192.168.100.30 --loginl
開機自啟動vim /etc/rc.d/rc.localiscsiadm --mode discovery --type sendtargets --portal 192.168.100.30iscsiadm --mode node --targetname iqn.2011-21.com.a.target:disk --portal 192.168.100.30 --loginl
initiator2安裝軟體[root@node1 ~]# yum -y install iscsi-initiator-utils
開啟服務[root@node1 ~]# service iscsi start[root@node1 ~]#chkconfig iscsi on
登陸磁碟[root@node1 ~]#iscsiadm --mode discovery --type sendtargets --portal 192.168.100.30[root@node1 ~]# iscsiadm --mode node --targetname iqn.2011-21.com.a.target:disk --portal 192.168.100.30 --loginl
開機自啟動vim /etc/rc.d/rc.localiscsiadm --mode discovery --type sendtargets --portal 192.168.100.30iscsiadm --mode node --targetname iqn.2011-21.com.a.target:disk --portal 192.168.100.30 –loginl
GFS檔案系統node1[root@node1 ~]#pvcreate /dev/sdb[root@node1 ~]#partprobe /dev/sdb[root@node1 ~]#service clvmd restart[root@node1 ~]#lvcreate -L 1500M -n lv1 vg1[root@node1 ~]#gfs_mkfs -p lock_dlm -t cluster1:lv1 -j 3 /dev/vg1/lv1 \\名字為群集名:邏輯卷名[root@node1 ~]#service clvmd restart
node2[root@node2 ~]#partprobe /dev/sdb[root@node2 ~]#service clvmd restart
注釋: 1.登陸磁碟後需要在每個結點上鍵入 partprobe /dev/sdb 同步磁碟資訊,建立卷組,邏輯卷後,兩個結點都會顯示卷組,邏輯卷資訊,如果不顯示 每個結點 鍵入service clvmd restart ! 2.設定GFS檔案系統需要在建立cluster1,添加結點之後,否則提示clvmd服務不存在!
node1配置修改主機名稱和hosts檔案[root@localhost ~]#vim /etc/sysconfig/networkHOSTNAME=node1.a.com[root@localhost ~]# hostname node1.a.com[root@localhost ~]#vim /etc/hosts192.168.100.10 node1.a.com node1192.168.100.20 node2.a.com node2
安裝軟體,開啟服務[root@localhost ~]#yum –y install ricci[root@localhost ~]#service ricci start[root@localhost ~]#chkconfig ricci on
node2配置修改主機名稱和hosts檔案[root@localhost ~]#vim /etc/sysconfig/networkHOSTNAME=node1.a.com[root@localhost ~]# hostname node1.a.com[root@localhost ~]#vim /etc/hosts192.168.100.11 node1.a.com node1192.168.100.20 node2.a.com node2
安裝軟體,開啟服務[root@localhost ~]#yum –y install ricci[root@localhost ~]#service ricci start[root@localhost ~]#chkconfig ricci on
luci設定安裝luci[root@target ~]# yum -y install luci
初始化 [root@target ~]#luci_admin init
重啟服務[root@target ~]#chkconfig luci on[root@target ~]#luci_admin init[root@target ~]#service luci restart群集設定建立cluster1
添加結點
建立fence
結點添加fence
建立失效域
添加資源IP
檔案
服務
添加服務
本文出自 “紫衣封侯” 部落格