검색

3장. LVS 설정

download PDF
LVS는 LVS 라우터 및 실제 서버라는 두 개의 기본 그룹으로 구성되어 있습니다. SPOF (single point of failure)를 방지하려면, 각각의 그룹에는 최소 두 개의 멤버 시스템이 있어야 합니다.
LVS 라우터 그룹은 Red Hat Enterprise Linux에서 실행되고 있는 두 개의 동일한 또는 유사한 시스템으로 구성되어 있어야 합니다. 하나의 시스템이 긴급 대기 모드에 있을 동안 다른 하나는 활성 LVS 라우터로 실행되어 두 개의 시스템이 가능한 동일한 기능을 가지고 있어야 합니다.
실제 서버 그룹 용 하드웨어를 선택 및 설정하기 전, 사용할 세 가지 LVS 토폴로지를 결정해야 합니다.

3.1. NAT LVS 네트워크

NAT 토폴로지는 기존 하드웨어를 사용하는 데에 있어서 광대한 사용 범위를 허용하지만 LVS 라우터를 통해 모든 패킷이 풀로 나가고 들어오기 때문에 거대한 부하량을 처리하는 데에는 기능이 제한되어 있습니다.
네트워크 레이아웃
NAT 라우팅을 사용한 LVS 용 토플로지는 클러스터가 공개 네트워크로 하나의 액세스 지점만을 필요로하기 때문에 네트워크 레이아웃에서 설정하는 것이 가장 간편합니다. 실제 서버는 모든 요청을 LVS 라우터를 통해 전달하므로 실제 서버의 개인 네트워크 상에 있게 됩니다.
하드웨어
NAT 토플로지는 실제 서버가 Linux 컴퓨터가 아니어도 올바르게 작동하게 하므로 하드웨어와 관련하여 가장 유연한 방법입니다. NAT 토플로지에서 각각의 실제 서버는 LVS 라우터에만 응답하기 때문에 하나의 NIC만을 필요로 합니다. 반면 LVS 라우터는 두 개의 네트워크 사이에서 소통량을 라우트 하기 위해 각각 두개의 NIC를 필요로 합니다. 이러한 토플로지는 LVS 라우터에서 네트워크 병목 현상을 가져오기 때문에, 기가바이트 이더넷 NIC는 각각의 LVS 라우터에서 사용되어 LVS 라우터가 처리할 수 있는 대역폭을 증가시킵니다. 기가바이트 이더넷이 LVS 라우터에서 사용될 경우, 실제 서버를 LVS 라우터로 연결하는 모든 스위치의 부하량을 효과적으로 처리하기 위해 최소 두개의 기가바이트 이더넷이 있어야 합니다.
소프트웨어
NAT 토폴로지 설정에서 iptables을 사용해야 하기 때문에, Piranha Configuration Tool 외에 소프트웨어 설정을 해야 할 수 있습니다. 특히, FTP 서비스 및 방화벽 표시 기능의 사용에서는 요청을 올바르게 라우트하기 위해 LVS 라우터에 대해 수동으로 추가 설정을 해야 합니다.

3.1.1. NAT를 사용한 LVS 용 네트워크 인터페이스 설정

To set up LVS with NAT, you must first configure the network interfaces for the public network and the private network on the LVS routers. In this example, the LVS routers' public interfaces (eth0) will be on the 192.168.26/24 network (I know, I know, this is not a routable IP, but let us pretend there is a firewall in front of the LVS router for good measure) and the private interfaces which link to the real servers (eth1) will be on the 10.11.12/24 network.
So on the active or primary LVS router node, the public interface's network script, /etc/sysconfig/network-scripts/ifcfg-eth0, could look something like this:
DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.26.9
NETMASK=255.255.255.0
GATEWAY=192.168.26.254
LVS 라우터 상의 개인 NAT 인터페이스 용 /etc/sysconfig/network-scripts/ifcfg-eth1 파일은 다음과 같이 나타납니다:
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.11.12.9
NETMASK=255.255.255.0
In this example, the VIP for the LVS router's public interface will be 192.168.26.10 and the VIP for the NAT or private interface will be 10.11.12.10. So, it is essential that the real servers route requests back to the VIP for the NAT interface.

중요

The sample Ethernet interface configuration settings in this section are for the real IP addresses of an LVS router and not the floating IP addresses. To configure the public and private floating IP addresses the administrator should use the Piranha Configuration Tool, as shown in 4.4절. “GLOBAL SETTINGS and 4.6.1절. “VIRTUAL SERVER 하부 섹션”.
After configuring the primary LVS router node's network interfaces, configure the backup LVS router's real network interfaces — taking care that none of the IP address conflict with any other IP addresses on the network.

중요

백업 노드에 있는 인터페이스는 주 노드에 있는 인터페이스와 같은 네트워크를 사용해야 합니다. 예를 들어, eth0가 주 노드 상의 공개 네트워크에 연결되어 있을 경우, 이는 백업 노드 상의 공개 네트워크에도 연결되어 있어야 합니다.

3.1.2. 실제 서버에서 라우팅

NAT 토폴로지에서 실제 서버 네트워크 인터페이스 설정 시 기억해 두어야 할 가장 중요한 사항은 LVS 라우터의 NAT 유동 IP 주소 용 게이트웨이를 설정해야 하는 것입니다. 예에서, 이 주소는 10.11.12.10으로 되어 있습니다.

참고

Once the network interfaces are up on the real servers, the machines will be unable to ping or connect in other ways to the public network. This is normal. You will, however, be able to ping the real IP for the LVS router's private interface, in this case 10.11.12.8.
So the real server's /etc/sysconfig/network-scripts/ifcfg-eth0 file could look similar to this:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.11.12.1
NETMASK=255.255.255.0
GATEWAY=10.11.12.10

주의

실제 서버의 GATEWAY= 행에 하나 이상의 네트워크 인터페이스가 설정되어 있을 경우, 첫번째로 나타나는 것이 게이트웨이가 됩니다. 따라서 eth0eth1이 설정되어 있고 eth1이 LVS에 사용될 경우, 실제 서버가 요청을 올바르게 라우트하지 못할 수 도 있습니다.
/etc/sysconfig/network-scripts/ 디렉토리에 있는 네트워크 인터페이스에서 ONBOOT=no를 설정하거나 또는 처음으로 나타나는 인터페이스에 게이트웨이가 올바르게 설정되어 있는 지를 확인하여 관련 없는 네트워크 인터페이스를 비활성화시키는 것이 좋습니다.

3.1.3. LVS 라우터에서 NAT 라우팅 활성화

In a simple NAT LVS configuration where each clustered service uses only one port, like HTTP on port 80, the administrator needs only to enable packet forwarding on the LVS routers for the requests to be properly routed between the outside world and the real servers. See 2.5절. “패킷 포워딩 활성화 ” for instructions on turning on packet forwarding. However, more configuration is necessary when the clustered services require more than one port to go to the same real server during a user session. For information on creating multi-port services using firewall marks, see 3.4절. “다중 포트 서비스 및 LVS ”.
Once forwarding is enabled on the LVS routers and the real servers are set up and have the clustered services running, use the Piranha Configuration Tool to configure LVS as shown in 4장. Piranha Configuration Tool를 사용하여 LVS 라우터 설정 .

주의

Do not configure the floating IP for eth0:1 or eth1:1 by manually editing network scripts or using a network configuration tool. Instead, use the Piranha Configuration Tool as shown in 4.4절. “GLOBAL SETTINGS and 4.6.1절. “VIRTUAL SERVER 하부 섹션”.
When finished, start the pulse service as shown in 4.8절. “LVS 시작하기 ”. Once pulse is up and running, the active LVS router will begin routing requests to the pool of real servers.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.