Redhat搭建RHCS和共用儲存

來源:互聯網
上載者:User

 

利用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/24initiator1安裝軟體[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 onnode2配置修改主機名稱和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 onluci設定安裝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 

檔案 

服務 

添加服務

 

本文出自 “紫衣封侯” 部落格

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.