Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ LVS + Keepalived the DR mode     - Ubuntu 12.04 64-bit installation Redmine + Git + ReviewBoard (Linux)

- How to install Linux Kernel 4.4 on Ubuntu (Linux)

- Five kinds of IO Model under Linux (Programming)

- Ubuntu program using the Sound Recorder (Linux)

- Linux compiler of GCC (Linux)

- Oracle Standby Redo Log experiment (Database)

- Use SecureCRT to transfer files between local and remote hosts (Linux)

- Linux System Getting Started Learning: the curl set custom HTTP header (Linux)

- CentOS system dual network card IP information configuration (Linux)

- Spring next ActiveMQ combat (Programming)

- Big Data Common Glossary (Linux)

- Ubuntu 14.04 compile RT288x_SDK / toolchain / squashfs3.2-r2 Error (Linux)

- Ubuntu 14.04 LTS installed Hadoop 1.2.1 (distributed cluster mode) (Server)

- Oracle SQL statement to retrieve data paging table (Database)

- Linux MultiPath software implementation instructions (Linux)

- Let Ubuntu 14.04 Save screen luminance value (Linux)

- Linux Basics Tutorial: Linux Kickstart automated installation (Linux)

- To compile and install Redis Linux and master-slave replication configuration (Database)

- Variables Python variables (Programming)

- QBit development of micro-services (Server)

 
         
  LVS + Keepalived the DR mode
     
  Add Date : 2018-11-21      
         
         
         
 

LVS + installation deployment
 
headend scheduler master: IP- > 10.252.3.10
headend scheduler backup: IP- > 10.252.3.11
VIP : 10.252.3.12
RealServer: 10.252.3.15
RealServer: 10.252.3.16
1: standby installed with keepalivedipvsadm
yum installkeepalived   ipvsadm   – y
Note : use ipvsadm – Ln can view the scheduling of the LVS
 
 
===================== ================================================== =============
2: configure /etc/keepalived/keepalived.conf
host 10.252.3.10 configured as follows:
vrrp_instanceVI_1 {
    state mASTER   the difference between point # standby, logo
    interface eth1           # corresponding card
    virtual_router_id 60  
    priority 101     # priority, who call the shots (the greater the value, the higher the priority)
    advert_int 2
    authentication {    # authentication mode and password must be the primary backup as
        auth_type PASS
        auth_pass 1234     # corresponding password
   }
    virtual_ipaddress {  # switching mode. Switching Virtual IP
        10.252.3.12/4
   }
}
Virtual_server10.252.3.12 80 {  # corresponding port where you can modify
      delay loop 6   # health check time
      lb_algo rr     # balance scheduling algorithm for a total of twelve species. Here polling method
      lb_kind DR     # load balancing forwarding rule, there are three: NAT, DR, TUN
      real_server 10.252.3.15 80 {
      weight 3
        TCP_CHECK {    #tcp polling to check the settings
                connect_timeout   3
                nb_get_retry   3
                delay_before_retry 3
                connect_port   80
       }
}
            real_server 10.252.3.16 80 {
      weight 3
        TCP_CHECK {    #tcp polling check the settings
                connect_timeout   3
                nb_get_retry   3
                delay_before_retry 3
                connect_port   80
       }
}
}
 
preparation machine configuration: keepalived configuration 10.252.3.11
Backup mainly to amend the two places the other are the same:
    state bACKUP   the difference between point # standby, logo
    priority 100     # priority, who call the shots (the greater the value, the priority The higher level)
========================================== ==========================================
3: in realserver to run the script
Because of the way the use of DR, we need to deploy the virtual machine on an actual address DIP and VIP address to communicate
lvs_init.sh write scripts below, the rear end of two virtual machines lvs_init script are the same:
# / bin / bash
#description:! Config realserver lo and apply noarp
SNS_VIP = 10.252.3.12
./etc/rc.d/ init.d / functions
case "$ 1" in
start)
      ifconfig lo: 0 $ SNS_VIP netmask255.255.255.255 broadcast $ SNS_VIP up # set lo: 0 the IP address
      / sbin / route add -host $ SNS_VIP dev lo: 0         # add routes
      echo "1" > / proc / sys / net / ipv4 / conf / lo / arp_ignore
      echo "2" > / proc / sys / net / ipv4 / conf / lo / arp_announce
      echo "1" > / proc / sys / net / ipv4 / conf / all / arp_ignore
      echo "2" > / proc / sys / net / ipv4 / conf / all / arp_announce
      sysctl -p > / dev / null 2 > & 1     # update the configuration
      echo "RealServer Start OK "
     ;;
stop)
      ifconfig lo: 0 down
      route del $ SNS_VIP > / dev / null2 > & 1
      echo "0" > / proc / sys / net / ipv4 / conf / lo / arp_ignore
      echo "0" > / proc / sys / net / ipv4 / conf / lo / arp_announce
      echo "0" > / proc / sys / net / ipv4 / conf / all / arp_ignore
      echo "0" > / proc / sys / net / ipv4 / conf / all / arp_announce
      echo "RealServer stoped"
     ;;
*)
      echo "Usage: $ 0 {start | stop}"
      exit 1
esac
exit 0
 
script permissions to chmod + x /data/script/lvs_init.sh
./lvs_init start / stop operation and stop scripts
Service keepalived start
use ipvsadm – Ln view lvs load balancing can be used to test webbech.

     
         
         
         
  More:      
 
- Spark parquet merge metadata problem (Server)
- IP configuration under Linux (Linux)
- Linux Log Clear (Linux)
- Understanding Java classes (Programming)
- Oracle 11g RMAN cross-platform transfer table space (Database)
- HTTPS and SSH and use the difference between the way: Git User's Manual (Linux)
- Design and implementation of environment sniffer running under Linux (Linux)
- Introduction and MongoDB CRUD (Database)
- How to protect your eyes automatically adjust the screen brightness on Linux (Linux)
- Using open source software to build XWiki Wiki system installed within the company (Linux)
- Java8 Lambda expressions and flow operations (Programming)
- extundelete: the Linux-based open source data recovery tools (Linux)
- Use HttpClient remote interface testing (Programming)
- Linux dmidecode command detail (Linux)
- CentOS 6.5 installation configuration DRBD (Server)
- MySQL query plan key_len know all (Database)
- Difference Redhat5 and 6 YUM source configuration (Linux)
- Oracle physical storage structure outline (Database)
- Linux System Getting Started Tutorial: Using the Linux common commands (Linux)
- Compile and install Redis and register as a system service under RedHat5.8 environment (Database)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.