天天看點

Linux負載均衡專題(個人心得和筆記按照下面的步驟就能建立可用的叢集)heartbeat2.1.4 實作監控應用服務(mysql)具體步驟RHEL-LVS 實驗(1)VS-NATredhatAS4.2 安裝叢集LVS

<a href="http://www.askwan.com/post/28/">http://www.askwan.com/post/28/</a>

haproxy+keepalived

Linux企業叢集

第一步:rsync同步web資料(測試通過并且自己加入了ssh的RSA key驗證)

第二步:安裝heartbeat并且可以故障切換(正在學習中..)

centos 5.2

yum install -y heartbeat heartbeat-devel heartbeat-ldirectord heartbeat-gui piranha

第三步:配置heartbeat

因為是rpm安裝是以預設/etc/ha.d/中沒有包含ha.cf,authkeys,haresources這三個檔案必須拷貝過來

rpm查詢cat /etc/ha.d/README.config

You need three configuration files to make heartbeat happy,

and they all go in this directory.

They are:

        ha.cf           Main configuration file

        haresources     Resource configuration file

        authkeys        Authentication information

These first two may be readable by everyone, but the authkeys file

must not be.

The good news is that sample versions of these files may be found in

the documentation directory (providing you installed the documentation).

If you installed heartbeat using rpm packages then

this command will show you where they are on your system:

                rpm -q heartbeat -d

If you installed heartbeat using Debian packages then

the documentation should be located in /usr/share/doc/heartbeat

然後利用cp把三個檔案拷貝到/etc/ha.d/中

第四步:具體安裝

<a href="http://linux.chinaunix.net/bbs/viewthread.php?tid=1051263">http://linux.chinaunix.net/bbs/viewthread.php?tid=1051263</a>

heartbeat2.x的測試終結篇,針對使用heartbeat的新手

注意:例如我們想做httpd的雙機熱備份的話,首先要把httpd的啟動腳本從init中删除

chkconfig --del httpd

chkconfig --level 345 httpd off

删除完成以後修改haresources

HA2 192.168.0.40 httpd

注意這裡生成完成了還是不能用必須用/usr/lib/heartbeat/haresources2cib.py haresources重新弄cib.xml和cib.xml.sig

主題:heartbeat V2在CentOS4.6上簡要安裝、配置筆記

<a href="http://www.javaeye.com/topic/191076">http://www.javaeye.com/topic/191076</a>

<a href="http://www.china-lg.com/blog/index.php?play=show&amp;id=553">http://www.china-lg.com/blog/index.php?play=show&amp;id=553</a>

Linux 上的高可用中間件,第 1 部分: heartbeat 與 Apache Web 伺服器

<a href="http://www.ibm.com/developerworks/cn/linux/l-halinux/index.html">http://www.ibm.com/developerworks/cn/linux/l-halinux/index.html</a>

LVS+Heartbeat+Ldirectord在RHEL5上

<a href="http://blog.chinaunix.net/u2/82873/showart_1405630.html">http://blog.chinaunix.net/u2/82873/showart_1405630.html</a>

基于LVS的網際網路應用

<a href="http://unix.ctocio.com.cn/196/8689196_5.shtml">http://unix.ctocio.com.cn/196/8689196_5.shtml</a>

基于LVS的Linux負載均衡技術實作

ipvsadm Man

<a href="http://linux.die.net/man/8/ipvsadm">http://linux.die.net/man/8/ipvsadm</a>

 利用LVS+Keepalived 實作高性能高可用負載均衡伺服器

<a href="http://www.linuxtone.org/thread-1077-1-1.html">http://www.linuxtone.org/thread-1077-1-1.html</a>

Linux Virtual Server負載均衡 ipvsadm使用方法

<a href="http://www.lslnet.com/linux/docs/linux-7916.htm">http://www.lslnet.com/linux/docs/linux-7916.htm</a>

使用LVS(Linux Virtual Server)在Linux上搭建負載均衡的叢集服務

<a href="http://www.clusting.com/cluster/load_balancing/LVS_1.html">http://www.clusting.com/cluster/load_balancing/LVS_1.html</a>

請教LVS三種工作模式和算法、session保持的問題!!!

有幾個關LVS問題,小弟想請教一下:

1、

在配置LVS時,小弟想用DR模式。我想請問一下如果确定使用此模式,或是改用NAT 或是TUN模式時,該通過ipvsadm的哪個指令參數指定,ipvsadm -A -t $VIP:80 -s rr 變化rr 這個參數指定的。

2、LVS的十種輪詢算法,該如何通過配置檔案或是指令指定。

3、在配置LVS不知道該如何解決session保持的問題,因為有些電子商務網站需要始終保持同一個連接配接,連接配接到同一個realserver.

-m NAT

-i TUN

算法:

-s 指定

session保持:-p

---這全在手冊中,或者ipvsadm -h都可以查到

多謝指點已經明白,小弟還有一問,請指點,,,

關于網站背景資料庫或資料同步的問題,小弟想到如下辦法:前提在沒有做共享磁盤的前提下,如果資料庫想要同步的話,可能要配置oracle熱備,如果是mysql就可配置主從,等等,關于網站其它檔案,如圖檔之類的,小弟想到rsync 或是在上傳時同步上傳。如果是做了共享磁盤,如果/date目錄吧。那麼幾台realserver可以挂載此目錄到本機了,網站的資料,還資料庫都可以放在此目錄了。。但問題是多個realserve要是同時寫一個檔案時,該如果是好呢?不知是否支援并行寫入,小弟覺得關于叢集配置磁盤共享這塊,也就是多個realserver資料同步的問題不太好解決,也是小弟最大凝問之處,很想有機會搭建SAN,或是NAS,好好試驗一下,如果搭建NAS,,使用linux的NFS就可以吧。而且也有一些叢集檔案系統GFS之類,等等。。。一直不太明确後端資料存儲的一緻性問題。

<a href="http://www.diybl.com/course/6_system/linux/Linuxjs/200868/123619.html">http://www.diybl.com/course/6_system/linux/Linuxjs/200868/123619.html</a>

在RHEL5中用piranha架設squid的lvs叢集

<a href="http://www.yatan.com/group/topic.php?tid=21513">http://www.yatan.com/group/topic.php?tid=21513</a>

在RHEL4系統中配置LVS負載均衡群集

<a href="http://www.linuxbyte.net.cn/article/rhel/2008-08-10/843.html">http://www.linuxbyte.net.cn/article/rhel/2008-08-10/843.html</a>

<a href="http://www.linuxtopia.org/online_books/rhel5/rhel5_clustering_guide/rhel5_cluster_s2-lvs-routing-CSO.html">http://www.linuxtopia.org/online_books/rhel5/rhel5_clustering_guide/rhel5_cluster_s2-lvs-routing-CSO.html</a>

rhel 5 cluseter

<a href="http://blog.80s.net.cn/?p=476">http://blog.80s.net.cn/?p=476</a>

lvs安裝以及配置

<a href="http://tech.ddvip.com/2008-11/122768078295163_3.html">http://tech.ddvip.com/2008-11/122768078295163_3.html</a>

<a href="http://bbs.bbsgood.com/post_45_129231_1.html">http://bbs.bbsgood.com/post_45_129231_1.html</a>

虛拟機中的lvs負載均衡