2014년 8월 5일 화요일

리눅스 클러스터링 간단 설정법

HEARTBEAT

1. yum install heartbeat

2. cp /usr/share/doc/heartbeat-2.1.3/ha.cf /etc/ha.d/
   cp /usr/share/doc/heartbeat-2.1.3/haresources /etc/ha.d/
   cp /usr/share/doc/heartbeat-2.1.3/authkeys /etc/ha.d/

3. chmod 600 /etc/ha.d/authkeys
   vi /etc/ha.d/authkeys
  auth 3
   #1 crc
   #2 sha1 HI!
   3 md5 Hello!

4. vi /etc/ha.d/ha.cf
   logfile /var/log/ha-log
   logfacility     local0
   deadtime 30
   initdead 120
   udpport 694
   bcast   eth0
   auto_failback on
   node    node1
   node    node2

5. vi /etc/ha.d/haresources
   node1 IP name


LVS

1. cp /usr/share/doc/ldirectord-2.1.3/ldirectord.cf /etc/ha.d/

2. vi /etc/ha.d/ldirectord.cf
   checktimeout=3
   checkinterval=1
   autoreload=yes
   quiescent=yes

   virtual=vip:port
        real=rip1:port gate
        real=rip2:port gate
        fallback=localip"port gate

3. echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore
   echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
   echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
   echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

4. /etc/sysctl.conf 파일에 net.ipv4.ip_forward = 1

   sysctl -p

댓글 없음:

댓글 쓰기