"우분투 keepalived 설치"의 두 판 사이의 차이

(새 문서: ==개요== ;리눅스 keepalived 설치 ==같이 보기== *keepalived ==같이 보기== * https://raymii.org/s/tutorials/Keepalived-Simple-IP-failover-on-Ubuntu.html 분류:...)
 
잔글 (봇: Apt-get 설치(을)를 Apt 설치(으)로 분류 대체함)
 
(다른 사용자 한 명의 중간 판 10개는 보이지 않습니다)
1번째 줄: 1번째 줄:
==개요==
;우분투 keepalived 설치
;리눅스 keepalived 설치
 
==패키지 설치==
<source lang='bash'>
apt-get install keepalived
</source>
 
==설정 파일 작성==
<source lang='bash'>
vim /etc/keepalived/keepalived.conf
</source>
* 서버 1
<source lang='aconf'>
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 100
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass $ place secure password here.
    }
    virtual_ipaddress {
        10.10.0.20
    }
}
</source>
* 서버 2
<source lang='aconf'>
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 99
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass $ place secure password here.
    }
    virtual_ipaddress {
        10.10.0.20
    }
}
</source>
* 서버 3
<source lang='aconf'>
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 98
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass $ place secure password here.
    }
    virtual_ipaddress {
        10.10.0.20
    }
}
</source>
 
==서비스 시작==
* 서버 1, 2, 3 모두 keepalived 시작
<source lang='console'>
root@server1:~# /etc/init.d/keepalived start
* Starting keepalived keepalived                                                  [ OK ]
</source>
 
==확인 2==
<source lang='console'>
root@server1:~# ps -ef | grep keepalived
root      2069    1  0 16:36 ?        00:00:00 /usr/sbin/keepalived
root      2070  2069  0 16:36 ?        00:00:00 /usr/sbin/keepalived
root      2071  2069  0 16:36 ?        00:00:00 /usr/sbin/keepalived
root      4338  4233  0 17:08 pts/0    00:00:00 grep --color=auto keepalived
</source>
<source lang='console'>
root@server1:~# netstat -nlp | grep keepalived
raw  214656      0 0.0.0.0:112            0.0.0.0:*              7          2071/keepalived
raw        0      0 0.0.0.0:112            0.0.0.0:*              7          2071/keepalived
raw        0      0 0.0.0.0:255            0.0.0.0:*              7          2071/keepalived
raw        0      0 0.0.0.0:255            0.0.0.0:*              7          2070/keepalived
</source>
<source lang='console'>
root@server1:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
      valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
      valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:46:d8:13:57:9f brd ff:ff:ff:ff:ff:ff
    inet 10.10.0.11/23 brd 10.10.1.255 scope global eth0
      valid_lft forever preferred_lft forever
    inet 10.10.0.20/32 scope global eth0
      valid_lft forever preferred_lft forever
    inet6 fa80::402:d4fb:ea68:135c/64 scope link
      valid_lft forever preferred_lft forever
</source>
<source lang='console'>
root@workstation:~# ping 10.10.0.20 -c 2
PING 10.10.0.20 (10.10.0.20) 56(84) bytes of data.
64 bytes from 10.10.0.20: icmp_seq=1 ttl=64 time=0.249 ms
64 bytes from 10.10.0.20: icmp_seq=2 ttl=64 time=0.250 ms
 
--- 10.10.0.20 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.249/0.249/0.250/0.015 ms
</source>


==같이 보기==
==같이 보기==
8번째 줄: 121번째 줄:
* https://raymii.org/s/tutorials/Keepalived-Simple-IP-failover-on-Ubuntu.html
* https://raymii.org/s/tutorials/Keepalived-Simple-IP-failover-on-Ubuntu.html


[[분류: 리눅스 네트워크]]
[[분류:리눅스 네트워크]]
[[분류:Apt 설치]]

2016년 4월 24일 (일) 22:37 기준 최신판

우분투 keepalived 설치

1 패키지 설치[ | ]

apt-get install keepalived

2 설정 파일 작성[ | ]

vim /etc/keepalived/keepalived.conf
  • 서버 1
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 100
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass $ place secure password here.
    }
    virtual_ipaddress {
        10.10.0.20
    }
}
  • 서버 2
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 99
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass $ place secure password here.
    }
    virtual_ipaddress {
        10.10.0.20
    }
}
  • 서버 3
vrrp_instance VI_1 {
    state BACKUP
    interface eth0
    virtual_router_id 50
    priority 98
    advert_int 1
    nopreempt
    authentication {
        auth_type PASS
        auth_pass $ place secure password here.
    }
    virtual_ipaddress {
        10.10.0.20
    }
}

3 서비스 시작[ | ]

  • 서버 1, 2, 3 모두 keepalived 시작
root@server1:~# /etc/init.d/keepalived start
 * Starting keepalived keepalived                                                   [ OK ]

4 확인 2[ | ]

root@server1:~# ps -ef | grep keepalived
root      2069     1  0 16:36 ?        00:00:00 /usr/sbin/keepalived
root      2070  2069  0 16:36 ?        00:00:00 /usr/sbin/keepalived
root      2071  2069  0 16:36 ?        00:00:00 /usr/sbin/keepalived
root      4338  4233  0 17:08 pts/0    00:00:00 grep --color=auto keepalived
root@server1:~# netstat -nlp | grep keepalived
raw   214656      0 0.0.0.0:112             0.0.0.0:*               7           2071/keepalived 
raw        0      0 0.0.0.0:112             0.0.0.0:*               7           2071/keepalived 
raw        0      0 0.0.0.0:255             0.0.0.0:*               7           2071/keepalived 
raw        0      0 0.0.0.0:255             0.0.0.0:*               7           2070/keepalived
root@server1:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 02:46:d8:13:57:9f brd ff:ff:ff:ff:ff:ff
    inet 10.10.0.11/23 brd 10.10.1.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet 10.10.0.20/32 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fa80::402:d4fb:ea68:135c/64 scope link 
       valid_lft forever preferred_lft forever
root@workstation:~# ping 10.10.0.20 -c 2
PING 10.10.0.20 (10.10.0.20) 56(84) bytes of data.
64 bytes from 10.10.0.20: icmp_seq=1 ttl=64 time=0.249 ms
64 bytes from 10.10.0.20: icmp_seq=2 ttl=64 time=0.250 ms

--- 10.10.0.20 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.249/0.249/0.250/0.015 ms

5 같이 보기[ | ]

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}