티스토리 뷰

___리눅스

[리눅스] 리눅스 HA구성(heartbeat)

변군 변군이글루 2014. 4. 28. 16:09

리눅스 HA구성

 

HA(High-Availability; 고가용성) 클러스터 구축 방법

 

1. Installing the required libnet rpm

rpm -Uvh http://mirror.premi.st/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum -y install libnet

 

2. Installing the heartbeat RPMS

yum -y install heartbeat

 

3. Copying the original Heartbeat sample config files into place

cp /usr/share/doc/heartbeat-3.0.4/authkeys /etc/ha.d/

cp /usr/share/doc/heartbeat-3.0.4/ha.cf /etc/ha.d/

cp /usr/share/doc/heartbeat-3.0.4/haresources /etc/ha.d/

 

chkconfig --level 35 heartbeat on

 

4. System Configuration

[Active]

[root@vm1 ~]# uname -n

vm1.scbyun.com

 

[root@vm1 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

 

192.168.100.129  vm1.scbyun.com vm1 # cluster member

192.168.100.130  vm2.scbyun.com vm2 # cluster member

192.168.100.100  CIP #cluster Ip

 

[root@vm1 ~]# cat /etc/ha.d/ha.cf

debugfile /var/log/ha-debug

logfile /var/log/ha-log

logfacility     local0

keepalive 2

deadtime 30

initdead 120

udpport 694

bcast   eth3       # Linux

auto_failback on

node vm1.scbyun.com

node vm2.scbyun.com


[root@vm1 ~]# cat /etc/ha.d/haresources

vm1.scbyun.com  192.168.100.100 smb

 

[root@vm1 ~]# chmod 600 /etc/ha.d/authkeys

[root@vm1 ~]# cat /etc/ha.d/authkeys

auth 1

#1 crc

#2 sha1 HI!

1 md5 Hello!

 

[Standby]

[root@vm2 ~]# uname -n

vm2.scbyun.com

 

[root@vm2 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

 

192.168.100.130  vm2.scbyun.com vm2 # cluster member

192.168.100.129  vm1.scbyun.com vm1 # cluster member

192.168.100.100  CIP #cluster IP

 

[root@vm2 ~]# cat /etc/ha.d/ha.cf

debugfile /var/log/ha-debug

logfile /var/log/ha-log

logfacility     local0

keepalive 2

deadtime 30

initdead 120

udpport 694

bcast   eth3       # Linux

auto_failback on

node vm1.scbyun.com

node vm2.scbyun.com

 

[root@vm2 ~]# cat /etc/ha.d/haresources

vm2.scbyun.com  192.168.100.100 smb

 

[root@vm2 ~]# chmod 600 /etc/ha.d/authkeys

[root@vm2 ~]# cat /etc/ha.d/authkeys

auth 1

#1 crc

#2 sha1 HI!

1 md5 Hello!

 




댓글
댓글쓰기 폼