Keepalived (VIP) builds Nginx high availability

On the basis of the previous two articles, building Nginx high availability is actually very simple. The principle is that Keepalived keeps Nginx alive, which is built in active-standby mode (hot standby). If HAProxy is added for traffic distribution at this time, it is active-active mode. Specifically, depending on the business background of the project, the situation of high traffic, do dual-active, only high availability, then use the active-standby mode.

Main components

  • Nginx
  • Keepalived

Construction process

  • Install Nginx and Keepalived
  • Write configuration files, pay attention to the parameters to be modified
  • Start installing Nginx and Keepalived, and test the VIP address

script

Find the following scripts in common middleware installation statements

  • Nginx installation script and Keepalived installation script:
    • InstallNginx.sh、InstallKeepalived.sh
  • Nginx and Keepalived configuration:
    • Nginx.conf、Keepalived.conf
  • VIP switching script:
    • ha_check.sh

Precautions

Guess you like

Origin blog.csdn.net/ljfirst/article/details/108573460