Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ LVS + Keepalived the DR mode     - Linux System Getting Started Tutorial: mounted directly in Linux LVM partition (Linux)

- RCU lock in the evolution of the Linux kernel (Linux)

- Mass data storage application of MongoDB database (Database)

- Ubuntu disable graphics card (Linux)

- Eclipse remove all comments and code spaces (Linux)

- Monitor traffic Linux Shell Edition (Programming)

- Nginx multi-domain certificate HTTPS (Server)

- Timing Nginx logs cut and remove the log records of the specified number of days before (Server)

- CentOS minimal network is unavailable resolved (Linux)

- To install the Ubuntu Touch emulator on Ubuntu (Linux)

- CentOS yum source deployment (Linux)

- IP configuration under Linux (Linux)

- OpenGL Programming Guide (8th edition of the original book) - compute shader (Programming)

- How to find out a Unix system library files are 32-bit or 64-bit (Linux)

- How to display a dialog Bash Shell script (Programming)

- Ceph performance optimization summary (v0.94) (Server)

- Elementary OS Freya global menu (Linux)

- Python common data type summary (Programming)

- Fedora 8 configured Heartbeat (Linux)

- MySQL + Corosync + Pacemaker + DRBD build highly available MySQL (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:      
 
- How MAT Android application memory leak analysis (Programming)
- Swift notes - let you two hours to learn Swift (Programming)
- To disable the function by pressing Ctrl-Alt-Del to restart the system in RHEL / CentOS 5/6 (Linux)
- Matters Oracle 11.2 single instance when connecting ASM need to pay attention and deal with the problem (Database)
- VMware ghost Linux card error (Linux)
- Google open source TCP team repaired the Linux kernel TCP flaw (Linux)
- Laravel 4.2 Laravel5 comprehensive upgrade Raiders (Server)
- Java Cookie Comments (Programming)
- PHP file upload methods exist in the database (Programming)
- Tomcat itself through simple movement separation (Server)
- Use Observium to monitor your network and servers (Server)
- Mac OS X Server installation and application (Linux)
- Using Linux stat command to view the files (Linux)
- Java by Spy Memcached to cache data (Programming)
- Zend Studio PHP syntax color scheme to export (Linux)
- Linux shell scripts bubble sort (Programming)
- C language Bubble Sort - integer sort (Programming)
- Plasma 5.4 How to install on Kubuntu 15.04 (Linux)
- Use PuTTY key authentication mechanism for remote login Linux (Linux)
- Boost - Memory Management - smart pointers (Programming)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.