Red Hat LINUX VIRTUAL SERVER 4.7 - ADMINISTRATION Manual 

Text of the manual

Linux Virtual Server Administration

Linux Virtual Server (LVS) for Red Hat Enterprise Linux 4.7 Virtual_Server_Administration ISBN: N/A Publication date: July 2008

Building a Linux Virtual Server (LVS) system offers highly-available and scalable solution for

production services using specialized routing and load-balancing techniques configured through the PIRANHA. This book discusses the configuration of high-performance systems and services with Red Hat Enterprise Linux 4.7 and LVS. Linux Virtual Server Administration

Linux Virtual Server Administration: Linux Virtual Server

(LVS) for Red Hat Enterprise Linux Copyright © 2008 Red Hat, Inc. Copyright © 2008 Red Hat, Inc. This material may only be distributed subject to the terms and conditions set forth in the Open Publication License, V1.0 or later with the restrictions noted below (the latest version of the OPL is presently available at http://www.opencontent.org/openpub/). Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder. Red Hat and the Red Hat "Shadow Man" logo are registered trademarks of Red Hat, Inc. in the United States and other countries. All other trademarks referenced herein are the property of their respective owners. The GPG fingerprint of the [email protected] key is: CA 20 86 86 2B D6 9D FC 65 F6 EC C4 21 91 80 CD DB 42 A6 0E 1801 Varsity Drive Raleigh, NC 27606-2072 USA Phone: +1 919 754 3700 Phone: 888 733 4281 Fax: +1 919 754 3701 PO Box 13588 Research Triangle Park, NC 27709 USA

Introduction .............................................................................................................. vii

1. Document Conventions ................................................................................ viii 2. Feedback ......................................................................................................ix 1. Linux Virtual Server Overview ................................................................................. 1 1. A Basic LVS Configuration .............................................................................. 1 1.1. Data Replication and Data Sharing Between Real Servers ..................... 3 2. A Three-Tier LVS Configuration ...................................................................... 3 3. LVS Scheduling Overview .............................................................................. 5 3.1. Scheduling Algorithms ......................................................................... 5 3.2. Server Weight and Scheduling ............................................................. 7 4. Routing Methods ............................................................................................ 7 4.1. NAT Routing ....................................................................................... 7 4.2. Direct Routing ..................................................................................... 9 5. Persistence and Firewall Marks ......................................................................11 5.1. Persistence ........................................................................................11 5.2. Firewall Marks ....................................................................................12 6. LVS — A Block Diagram ................................................................................12 6.1. LVS Components ...............................................................................14 2. Initial LVS Configuration ........................................................................................17 1. Configuring Services on the LVS Routers .......................................................17 2. Setting a Password for the Piranha Configuration Tool .................................18 3. Starting the Piranha Configuration Tool Service ...........................................18 3.1. Configuring the Piranha Configuration Tool Web Server Port .............19 4. Limiting Access To the Piranha Configuration Tool ......................................20 5. Turning on Packet Forwarding .......................................................................21 6. Configuring Services on the Real Servers .......................................................21 3. Setting Up LVS .....................................................................................................23 1. The NAT LVS Network ..................................................................................23 1.1. Configuring Network Interfaces for LVS with NAT .................................23 1.2. Routing on the Real Servers ...............................................................25 1.3. Enabling NAT Routing on the LVS Routers ..........................................25 2. LVS via Direct Routing ..................................................................................26 2.1. Direct Routing and arptables_jf .......................................................27 2.2. Direct Routing and iptables ..............................................................28 3. Putting the Configuration Together .................................................................29 3.1. General LVS Networking Tips .............................................................30 4. Multi-port Services and LVS ...........................................................................30 4.1. Assigning Firewall Marks ....................................................................31 5. Configuring FTP ............................................................................................32 5.1. How FTP Works .................................................................................32 5.2. How This Affects LVS Routing ............................................................33 5.3. Creating Network Packet Filter Rules ..................................................33 6. Saving Network Packet Filter Settings ............................................................35 4. Configuring the LVS Routers with Piranha Configuration Tool ...............................37 1. Necessary Software ......................................................................................37 2. Logging Into the Piranha Configuration Tool ................................................37 v

Other Server Manuals