티스토리 뷰

LAYER 4 & 7

keepalived 2.0.7 설치 (centos7)

초보의 CHOMAN 2018.09.06 19:04


keepalived 2.0.7 설치




환경



centos7 64bit (최소설치)

keepalived 2.0.7

 



HA 구성을 위한 VRRP 설정시 동일하게 2대 설치 진행한다.




사전 필요 패키지 설치



yum install wget gcc openssl-devel net-tools ipvsadm

 





keepalived 다운로드 페이지



http://www.keepalived.org/download.html

 






다운로드 (2.0.7)



wget http://www.keepalived.org/software/keepalived-2.0.7.tar.gz

 






keepalived 설치



# 압축해제

tar xvfz keepalived-2.0.7.tar.gz

 

# 설치

./configure --prefix=/usr/local/

make

make install


# systemd 활성화

systemctl enable keepalived.service





keepalived.conf example)



! Configuration File for keepalived


global_defs {

   notification_email {

     takakocap@naver.com

   }

   notification_email_from admin@keepalived.com

   vrrp_check_unicast_src

   smtp_server 127.0.0.1

   smtp_connect_timeout 30

   smtp_alert yes

}


vrrp_instance VI_1 {

    state MASTER

    interface enp0s3

    virtual_router_id 1

    priority 101

    advert_int 1

    authentication {

        auth_type PASS

        auth_pass 1111

    }

    virtual_ipaddress {

        192.168.0.250 dev enp0s3 label enp0s3:0

    }

    unicast_peer {

        192.168.0.252

    }

}


virtual_server 192.168.0.250 80 {

    delay_loop 6

    retry 2

    lb_algo rr

    lb_kind NAT

    protocol TCP


    real_server 192.168.0.253 80 {

        weight 1

TCP_CHECK {

    connect_port 80

    connect_timeout 3

    }

    }

real_server 192.168.0.254 80 {

        weight 1

TCP_CHECK {

    connect_port 80

    connect_timeout 3

    }

    }

}

 


: VRRP 설정시 priority 값만 다르게 설정




keepalived 보내는 발송 메일 설정



systemctl enable postfix

systemctl start postfix

 




error)

Unable to find configuration file /etc/keepalived/keepalived.conf (glob returned 3)



mkdir /etc/keepalived

ln -sf /usr/local/etc/keepalived/keepalived.conf /etc/keepalived/keepalived.conf

 




keepalived 메뉴얼



http://www.keepalived.org/manpage.html#

 



'LAYER 4 & 7' 카테고리의 다른 글

keepalived 2.0.7 설치 (centos7)  (0) 2018.09.06
안전하지 않은 컨텐츠가 차단됨  (0) 2018.04.13
haproxy client ip 추출  (0) 2018.04.11
HAPROXY SSL  (0) 2018.04.11
HAPROXY HDR  (0) 2018.04.11
centos7 ipvsadm  (0) 2018.04.10
댓글
댓글쓰기 폼
공지사항
Total
671,440
Today
48
Yesterday
158
링크
«   2018/09   »
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
글 보관함