🐧 Linux Virtual Server for the dim-witted (Redhat Version 8)

🐧 Linux Virtual Server for the dim-witted (Redhat Version 8)

This document only applies to the Director

Requirements

Setup

  1. Copy linux-2.4.18.tar.gz to /usr/src
  2. Gunzip linux-2.4.18.tar.gz <enter>
  3. Tar xvf linux-2.4.18.tar <enter>
  4. Cd linux <enter>

(please not that although the file below says gz, it is infact just and file and not a gzip file).

cat /patch_location/linux-2.4.18-ipvs-1.0.4.patch.gz | patch –p1
cat /patch_location/hidden-2.4.5-1.diff | patch –p1
cat /patch_location/ fib-245-1.diff | patch –p

Make menuconfig

Go down to the bottom and select the option Load an Alternate Configuration File in the prompt.

type /boot/config-2.4.18-14

Now under the heading below set each of the options as shown.

Code maturity level options  --->
   [*] Prompt for development and/or incomplete code/drivers

Networking options  --->
<*> Packet socket                                                     
      [ ] Packet socket: mmapped IO                                       
      [*] Kernel/User netlink socket                                        
      [*] Routing messages                                                 
      <*> Netlink device emulation                                        
      [*] Network packet filtering (replaces ipchains)                      
      [*] Network packet filtering debugging                              

      [*] Socket Filtering                                                  
      <*> Unix domain sockets                                               
      [*] TCP/IP networking                                                 
      [*]   IP: multicasting                                                 
      [*]   IP: advanced router                                             
      [*]     IP: policy routing                                            
      [*]       IP: use netfilter MARK value as routing key                 
      [*]       IP: fast network address translation                        
      [*]     IP: equal cost multipath                                      
      [*]     IP: use TOS value as routing key                              
      [*]     IP: verbose route monitoring                                   
      [*]     IP: large routing tables                                      
      [*]   IP: kernel level autoconfiguration                              
      [ ]     IP: BOOTP support                                             
      [ ]     IP: RARP support                                              
      <*> IP: tunneling                                                   
      < > IP: GRE tunnels over IP                                         
      [*]   IP: multicast routing                                            
      [ ]   IP: ARP daemon support (EXPERIMENTAL)                           
      [ ]   IP: TCP Explicit Congestion Notification support                
      [ ]   IP: TCP syncookie support (disabled per default)                
        IP: Netfilter Configuration  --->
          IP: Virtual Server Configuration  --->
        < > The IPv6 protocol (EXPERIMENTAL)                                
      < > Kernel httpd acceleration (EXPERIMENTAL)                        
      [ ] Asynchronous Transfer Mode (ATM) (EXPERIMENTAL)

IP: Netfilter Configuration  --->
<*> Connection tracking (required for masq/NAT)
      <*> FTP protocol support
      <*> Userspace queueing via NETLINK (EXPERIMENTAL)
      <*> IP tables support (required for filtering/masq/NAT)
      <*> limit match support
      <*> MAC address match support
      <*> netfilter MARK match support
      <*> Multiple port match support
      <*> TOS match support
      <*> Connection state match support
      <*> Unclean match support (EXPERIMENTAL)
      <*> Owner match support (EXPERIMENTAL)
      <*> Packet filtering
      <*> REJECT target support
      <*> MIRROR target support (EXPERIMENTAL)
      <*> Full NAT
      <*> MASQUERADE target support
      <*> REDIRECT target support
      <*> Packet mangling
      <*> TOS target support
      <*> MARK target support
      <*> LOG target support
      <*> ipchains (2.2-style) support
      <*> ipfwadm (2.0-style) support   
 

IP: Virtual Server Configuration  --->
<M> virtual server support (EXPERIMENTAL)                                      
      [*]   IP virtual server debugging (NEW)                                        
      (16)   IPVS connection table size (the Nth power of 2) (NEW)                   
      --- IPVS scheduler                                                             
      <*> round-robin scheduling (NEW)                                             
      <*> weighted round-robin scheduling (NEW)                                    
      <*> least-connection scheduling scheduling (NEW)                             
      <*> weighted least-connection scheduling (NEW)                               
      <*> locality-based least-connection scheduling (NEW)                         
      <*> locality-based least-connection with replication scheduling (NEW)        
      <*> destination hashing scheduling (NEW)                                     
      <*> source hashing scheduling (NEW)                                           
      --- IPVS application helper                                                    
      <*> FTP protocol helper (NEW)

Once you have set the options then exit and save. Next type:

  • Make dep <enter> then Make modules <enter> then Make modules_install
  • then Make bzImage <enter> then Make install> then reboot machine
  • download and install fping http://www.fping.com/download (This will be needed on each machine at the configure script stage.
See also  Tomcat ⚙️ Configuration and properties files


You are now ready for the next stage.

Configuring Linux Virtual Server using configure-lvs_0.9.4

  • Install all of the supplied perl rpm’s in the heartbeat folder.
  • Install Net-DNS-0.19.tar.gz to you config area
    • Gunzip Net-DNS-0.19.tar.gz
    • Tar xvf Net-DNS-0.19.tar
    • Cd Net-DNS-0.19.
    • Perl Makefile.PL
    • Make
    • Make test
    • Make install
  • Install configure-lvs_0.9.4.tar.gz
    • Gunzip configure-lvs_0.9.4.tar.gz
    • Tar xvf configure-lvs_0.9.4.tar
  • vi lvs_nat.conf.one_NIC_two_network
#----------lvs_nat.conf------------------------------------
LVSCONF_FORMAT=1.1

LVS_TYPE=VS_NAT

INITIAL_STATE=on

CLEAR_IPVS_TABLES=yes

#

#VIP line format - device[:alias] IP netmask broadcast

#To help avoid namespace collisions with other VIPs, I set alias=last number of

VIP (here 110).

VIP=eth0:110 DirOut 255.255.255.0 192.168.210.255

#

#DIP line format - device[:alias] IP network netmask broadcast

DIP=eth0 Director 192.168.210.0 255.255.255.0 192.168.210.255

#

#DIRECTOR_GW - packets with src_addr=VIP, dst_addr=0/0 are sent to DIRECTOR_GW

#to be forwarded to the outside world.

#The script will not necessarily set up the DIRECTOR_GW as the director's default gw.

DIRECTOR_GW=Director

#

#SERVICE line format - proto port scheduler IP|name:port[,weight] [IP|name:port[

#weight]]

#SERVICE=t telnet rr RS1:telnet RS2:telnet RS3:telnet RS4:telnet

SERVICE=t telnet wlc RealServ1:telnet,1 RealServ2:telnet,1

SERVICE=t http wlc RealServ1:http,1 RealServ2:http,1

#

SERVER_NET_DEVICE=eth0

#VS-NAT real-servers do not have a VIP, i.e. there is no SERVER_VIP_DEVICE

#SERVER_VIP_DEVICE=

#SERVER_GW is not user configurable with VS-NAT. script sets SERVER_GW = DIP

#SERVER_GW=

#----------end lvs_nat.conf---------------------------------
  • Edit the lvs_nat.conf.one_NIC_two_network to suite your network
    • ./configure lvs_nat.conf.one_NIC_two_network
  • if no errors occur run
    • ./rc.lvs_naton the director and the real servers
  • check iptables
    • cd /sbin
    • iptables –L
  • if empty, set default settings then
  • iptables –L if okay then /etc/rc.d/init.d/iptables save

the director should work now.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.