【正文】
: [ OK ] [ OK ] [root@web1 ~] /etc/Logging out of session [sid: 1, target: :targetB, portal: ,3260] Logout of [sid: 1, target: :targetB, portal: ,3260]: successful Stopping iSCSI daemon: iscsid dead but pid file exists [ OK ] Starting iSCSI daemon: [ OK ] [ OK ] Setting up iSCSI targets: Logging in to [iface: default, target: :targetB, portal: ,3260] Login to [iface: default, target: :targetB, portal: ,3260]: successful [ OK ] [root@web1 ~] ls /dev/iscsi/target 查看設(shè)備 /dev/iscsi/target 配置成 pvvglv 只需要在一臺使用存儲端配置 lv,其它存儲使用端激活使用即可 [root@web1 ~] pvcreate /dev/iscsi/target Physical volume /dev/iscsi/target successfully created [root@web1 ~] vgcreate sanvg /dev/iscsi/target /dev/hdc: open failed: No medium found Volume group sanvg successfully created [root@web1 ~] lvcreate n sanlv L 500M sanvg /dev/hdc: open failed: No medium found Logical volume sanlv created [root@web1 ~] lvs /dev/hdc: open failed: No medium found LV VG Attr LSize Origin Snap% Move Log Copy% Convert LogVol00 VolGroup00 wiao LogVol01 VolGroup00 wiao sanlv sanvg wia 其它存儲使用端激活使用即可 [root@web2 ~] pvscan PV /dev/hda2 VG VolGroup00 lvm2 [ GB / 0 free] PV /dev/sda VG sanvg lvm2 [ MB / MB free] Total: 2 [ GB] / in use: 2 [ GB] / in no VG: 0 [0 ] [root@web2 ~] vgchange ay sanvg 1 logical volume(s) in volume group sanvg now active 集群的配置 在 WEB 服務器 上配置 CLVM [root@web1 ~] yum y install lvm2cluster [root@web1 ~] lvmconf enablecluster 安裝 cman ricci, 設(shè)置開機啟動 [root@web1 ~] yum install cman ricci y [root@web1 ~] chkconfig cman on [root@web1 ~] chkconfig ricci on [root@web1 ~] /etc/ Starting oddjobd: [ OK ] generating SSL certificates... done Starting ricci: [ OK ] 用一臺其他的機器安裝 luci 來管理集群,本實驗用 ftp 的機器來操作 [root@ftp ~] yum install luci y [root@ftp ~]chkconfig luci on [root@ftp ~] luci_admin init 設(shè)置密碼 Initializing the luci server Creating the 39。admin39。 user Enter password: Confirm password: Please wait... The admin password has been successfully set. Generating SSL certificates... The luci server has been successfully initialized You must restart the luci server for changes to take effect. Run service luci restart to do so [root@ftp ~] service luci restart Shutting down luci: [ OK ] Starting luci: Generating SSL certificates... done [ OK ] Point your web browser to to access luci 訪問網(wǎng)址 配置集群 , 獲取證書 并 登陸 , 配置集群名字,集群包含的 集群及密碼,重啟 ,如下圖 圖 集群配置頁面 重啟過程中,等待完成。重啟后, 如果 沒有報錯,集群配置成功,可以看到相關(guān)的設(shè)置頁面 創(chuàng) 建 GFS2 文件系 統(tǒng) 及 測試 [root@web1 ~] yum install kmodgfs gfs2utils y [root@web1 ~] t sancluster:tablesan j 2 p lock_dlm /dev/sanvg/sanlv 格式化成 gfs2 文件系統(tǒng) This will destroy any data on /dev/sanvg/sanlv. It appears to contain a gfs2 filesystem. Are you sure you want to proceed? [y/n] y Device: /dev/sanvg/sanlv Blocksize: 4096 Device Size GB (128000 blocks) Filesystem Size: GB (127997 blocks) Journals: 2 Resource Groups: 2 Locking Protocol: lock_dlm Lock Table: sancluster:tablesan UUID: 0EA76425B03EF110BC7B53A3F65112E8 [root@web1 ~] /dev/sanvg/sanlv /var//html/ 掛載到 web 服務器默認主目錄下 [root@web1 ~] vim /etc/ 在配置文件中添加開機自動掛載 /dev/sanvg/sanlv /var//html/ [root@web1 ~] chkconfig gfs2 on 設(shè)置服務開機啟動 [root@web1 ~] vim /var//html/ 在 web1 上創(chuàng)建文件 This is SAN [root@web2 html] cat 在 web2 上可以查看到 This is SAN 客戶端 網(wǎng)關(guān)指向 DGW 訪問 VIP 測試,可以訪問到 SAN 服務器上的網(wǎng)頁結(jié)果 圖 客戶端測試結(jié)果 在 LVS 服務器上查看分發(fā)狀態(tài) 圖 LVS 分發(fā)狀態(tài)結(jié)果 Discuz 論壇搭建 在兩臺 web 服務器上安裝相關(guān)服務軟件包,并設(shè) 置開機啟動 [root@web1 html]yum install * mysql* php* y [root@web1 html]chkconfig mysqld on [root@web1 html]service mysqld start 默認密碼為空 [root@web1 html]vim /etc/d/conf/d/conf 找到 的位置 在后面添加 [root@web1 html]cd /var//html [root@web1 html]mkdir bbs [root@web1 html]cd bbs/ 把下載的 Discuz 源碼解壓到此目錄,然后訪問網(wǎng)頁安裝 ,如下圖 圖 論壇搭建 1 圖 論壇搭建 2 給那些不可寫的文件改變權(quán)限 ,然后刷新網(wǎng)頁 圖 論壇搭建 3 圖 論壇搭建 4 圖 論壇搭建 5 在后臺添加一些模塊,然后在前臺刷新查看 圖 論壇搭建 6 4 總 結(jié) 這次的 實踐項目主要研究了企業(yè)級的網(wǎng)絡(luò)服務架構(gòu),在搭建了負載均衡的情況下來實施整個工程,而后臺的存儲又方便的數(shù)據(jù)的備份和維護,項目的主要難點在于細節(jié)方面,比如 web 服務器在 LVS 中怎么解決 IP 的問題, SAN 存儲中的集群問題,可以在以后不斷的來完善項目,把負載均衡和高可用集群來結(jié)合在一起,再添加一套監(jiān)控的設(shè)備到項目中, web 服務的部分可以加上 memory cache 來提高訪問的速度,這些會在以后的項目中不斷完善。