linux ×öË«»úÈȱ¸
1.1 Ê×ÏÈÏÂÔØlibnet.tar.gz£¬heartbeat-2.0.4.tar.gz
1.2 °´Ë³ÐòÏÖ×°libnetÔÙ×°heartbeat
¶¼ÊÇÔ´Âë°ü£¬½âѹ¿ªºó·Ö±ðÖ´ÐУº
./configure ;make ;make install;
°²×°Íê±Ï¡£
1.3 Èí¼þµÄÅäÖÃ
HeartbeatÈí¼þµÄ°²×°Ä¿Â¼Îª/usr/local/etc/ha.d£¬ÆäÖеÄREADME.config¶ÔÅäÖÃÎļþ½øÐÐÁË˵Ã÷£¬¹²ÓÐÈý¸öÖ÷ÒªµÄÅäÖÃ
Îļþ£ºha.cf£¬haresources£¬authkeys¡£
ʹÓÃÃüÁî rpm -q heartbeat -d »òÕß find / -name ha.cf ¾ù¿ÉÒÔÕÒµ½ÉÏÊöÈý¸öÅäÖÃÎļþ£¬ËùÔÚĿ¼Ϊ:
/usr/local/share/doc/heartbeat-2.0.4¡£
ÏÂÃæÒÀ´Î¶ÔÈý¸öÅäÖÃÎļþ½øÐÐ˵Ã÷£¬´ËÍâÓû§»¹¿ÉÒԲο¼Linux-HA¸½´øµÄ°²×°ÎĵµÒÔ¼°ÅäÖÃÎļþ×ÔÉíµÄ×¢ÊÍ¡£
1.3.1 ÅäÖÃha.cfÎļþ
ha.cfÊÇheartbeatµÄÖ÷ÒªÅäÖÃÎļþ£¬¿ÉÒÔ¶ÔheartbeatµÄ¶àÊýÐÔÄܺÍ״̬½øÐÐÅäÖᣴ󲿷ÖÑ¡ÏîµÄÈ¡Öµ¿ÉÒÔ²ÉÓÃĬÈÏÖµ£¬ÆäÖеÄÖ÷ҪѡÏî¼°ÅäÖ÷½·¨ËµÃ÷ÈçÏ£º
debugfile /var/log/ha-debug£º¸ÃÎļþ±£´æheartbeatµÄµ÷ÊÔÐÅÏ¢
logfile /var/log/ha-log£ºheartbeatµÄÈÕÖ¾Îļþ
keepalive 2£ºÐÄÌøµÄʱ¼ä¼ä¸ô£¬Ä¬ÈÏʱ¼äµ¥Î»ÎªÃë
deadtime 30£º³¬³ö¸Ãʱ¼ä¼ä¸ôδÊÕµ½¶Ô·½½ÚµãµÄÐÄÌø£¬ÔòÈÏΪ¶Ô·½ÒѾËÀÍö¡£
warntime 10£º³¬³ö¸Ãʱ¼ä¼ä¸ôδÊÕµ½¶Ô·½½ÚµãµÄÐÄÌø£¬Ôò·¢³ö¾¯¸æ²¢¼Ç¼µ½ÈÕÖ¾ÖС£
initdead 120£ºÔÚijЩϵͳÉÏ£¬ÏµÍ³Æô¶¯»òÖØÆôÖ®ºóÐèÒª¾¹ýÒ»¶Îʱ¼äÍøÂç²ÅÄÜÕý³£¹¤×÷£¬¸ÃÑ¡ÏîÓÃÓÚ½â¾öÕâÖÖÇé¿ö²úÉúµÄʱ¼ä¼ä¸ô¡£È¡ÖµÖÁÉÙΪdeadtimeµÄÁ½±¶¡£
udpport 694£ºÉèÖù㲥ͨÐÅʹÓõĶ˿ڣ¬694ΪĬÈÏʹÓõĶ˿ںš£
baud 19200£ºÉèÖô®ÐÐͨÐŵIJ¨ÌØÂÊ¡£
serial /dev/ttyS0£ºÑ¡Ôñ´®ÐÐͨÐÅÉ豸£¬ÓÃÓÚË«»úʹÓô®¿ÚÏßÁ¬½ÓµÄÇé¿ö¡£Èç¹ûË«»úʹÓÃÒÔÌ«ÍøÁ¬½Ó£¬ÔòÓ¦¸Ã¹Ø±Õ¸ÃÑ¡Ïî¡£
bcast eth0£ºÉèÖù㲥ͨÐÅËùʹÓõÄÍøÂç½Ó¿Ú¿¨¡£
auto_failback on£ºheartbeatµÄÁ½Ì¨Ö÷»ú·Ö±ðΪÖ÷½ÚµãºÍ´Ó½Úµã¡£Ö÷½ÚµãÔÚÕý³£Çé¿öÏÂÕ¼ÓÃ×ÊÔ´²¢ÔËÐÐËùÓеķþÎñ£¬
Óöµ½¹ÊÕÏʱ°Ñ×ÊÔ´½»¸ø´Ó½Úµã²¢ÓÉ´Ó½ÚµãÔËÐзþÎñ¡£ÔÚ¸ÃÑ¡ÏîÉèΪonµÄÇé¿öÏ£¬Ò»µ©Ö÷½Úµã»Ö¸´ÔËÐУ¬Ôò×Ô¶¯»ñÈ¡
×ÊÔ´²¢È¡´ú´Ó½Úµã£¬·ñÔò²»È¡´ú´Ó½Úµã¡£
ping ping-node1 ping-node2£ºÖ¸¶¨ping node£¬ping node²¢²»¹¹³ÉË«»ú½Úµã£¬ËüÃǽö½öÓÃÀ´²âÊÔÍøÂçÁ¬½Ó¡£
respawn hacluster /usr/lib/heartbeat/ipfail£ºÖ¸¶¨ÓëheartbeatһͬÆô¶¯ºÍ¹Ø±ÕµÄ½ø³Ì£¬¸Ã½ø³Ì±»×Ô¶¯¼àÊÓ£¬
Óöµ½¹ÊÕÏÔòÖØÐÂÆô¶¯¡£×î³£ÓõĽø³ÌÊÇipfail£¬¸Ã½ø³ÌÓÃÓÚ¼ì²âºÍ´¦ÀíÍøÂç¹ÊÕÏ£¬ÐèÒªÅäºÏpingÓï¾äÖ¸¶¨µÄping
nodeÀ´¼ì²âÍøÂçÁ¬½Ó¡£
¾ßÌåÄÚÈݾÙ
Ïà¹ØÎĵµ£º
2009 Äê 4 ÔÂ 23 ÈÕ
±¾ÎÄÖÐÎÒÃÇÕë¶Ô Linux É϶àÏ̱߳à³ÌµÄÖ÷ÒªÌØÐÔ×ܽá³ö 5 Ìõ¾Ñ飬ÓÃÒÔ¸ÄÉÆ Linux ¶àÏ̱߳à³ÌµÄÏ°¹ßºÍ±ÜÃâÆäÖеĿª·¢ÏÝÚå¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃÇ´©²åһЩ Windows µÄ±à³ÌÓÃÀýÓÃÒÔ¶Ô±È Linux ÌØÐÔ£¬ÒÔ¼ÓÉî¶ÁÕßÓ¡Ïó¡£
±³¾°
Linux ƽ̨ÉϵĶàÏ̳߳ÌÐò¿ª·¢Ïà¶ÔÓ¦ÆäËûƽ̨£¨±ÈÈç Windows£©µÄ¶àÏß³Ì API ÓÐһЩϸ΢ ......
viÓëvimÒ»Ñù¶¼ÊDZà¼Æ÷£¬²»Í¬µÄÊÇvim¸ü¸ß¼¶Ò»Ð©£¬¿ÉÒÔÀí½âÊÇviµÄ¸ß¼¶°æ±¾¡£vi¾ÍÏñWindowsÖеļÆʱ¾£¬¶øvimÔò¿ÉÒÔËãµÄÉÏÊÇ
officeÖеÄword¡£viÖ÷ÒªÓÃÀ´±à¼Ò»Ð©Îļþ£¬vimÊdzÌÐòÔ±µÄºÃ¹¤¾ß¡£ºÃµÄ¡£¡£¡£¡£ÏÂÃæÔÚ½éÉÜÒ»ÏÂviµÄʹÓᣡ£¡£¡£¡£¡£
1.
ʹÓÃvi½øÈëÒ»°ãģʽ
[root@linux ~]# vi test.tx ......
# uname -a
Linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
(²é¿´µ±Ç°²Ù×÷ϵͳÄÚºËÐÅÏ¢)
# cat /etc/issue | grep Linux
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
(²é¿´µ±Ç°²Ù×÷ϵͳ·¢ÐаæÐÅÏ¢)
# cat /proc/cpuinfo | grep name | cut -f2 -d: ......
ÔÎļû£ºhttp://www.cppblog.com/flashboy/articles/47012.html
1¡¢ÐÞ¸ÄÓû§½ø³Ì¿É´ò¿ªÎļþÊýÏÞÖÆ
ÔÚLinuxƽ̨ÉÏ£¬ÎÞÂÛ±àд¿Í»§¶Ë³ÌÐò»¹ÊÇ·þÎñ¶Ë³ÌÐò£¬ÔÚ½øÐи߲¢·¢TCPÁ¬½Ó´¦Àíʱ£¬×î¸ßµÄ²¢·¢ÊýÁ¿¶¼ÒªÊܵ½ÏµÍ³¶ÔÓû§µ¥Ò»½ø³Ìͬʱ¿É´ò¿ªÎļþÊýÁ¿µÄÏÞÖÆ(ÕâÊÇÒòΪϵͳΪÿ¸öTCPÁ¬½Ó¶¼Òª´´½¨Ò»¸ösocket¾ä±ú£¬Ã¿¸ ......
ÓÉÓÚ£¬ÐèÒª¶¨Ê±±¸·ÝÊý¾Ý£¬ËùÒÔʹÓà 7zaÀ´´ò°ü¡£¡£¡£ Ä¿±êÎļþ¼Ð¾³£º¬ÓдóÁ¿µÄÓû§ÉÏ´«Í¼Æ¬£¬ÕâЩͼƬÎÞÐè¸ßÃܶȶ¨ÆÚ±¸·Ý£¬ËùÒÔ£¬Ï£ÍûÔÚ´ò°üµÄʱºòÅųýËüÃÇ¡£¡£
Ñо¿ÁËÒ»ÏÂ7zaµÄÃüÁîÐУ¬´óÖ¿ÉÒÔÕâÑùÍê³É£º
7za a '-x!backup/fold/' test.zip backup
&nb ......