Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - CentOS7 set boot directly into the command line interface (Linux)

- Oracle large table to clean truncate .. reuse storage (Database)

- VSFTPD Security (Linux)

- Linux more command Detailed (Linux)

- The development environment to build Nodejs under Ubuntu 14.04 (Linux)

- Oracle metadata Reconstruction experiments (Database)

- 11G ASM disk group does not automatically handle MOUNT (Database)

- Android development, may cause a memory leak problem (Programming)

- MySQL full-index scan bug (Database)

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

- CentOS 6 Install Linux kernel source (Linux)

- Linux modify the network interface name (Linux)

- Oracle 12C with multi-column index (Database)

- Install the latest development version of Wine on RedHat and Debian-based systems (Linux)

- How to use the Linux terminal Git commands (Linux)

- Ubuntu 15.10 installation and deployment Swift development environment (Linux)

- Oracle Database Delete Delete million or more common method of heap table data (Database)

- Ubuntu and derivative users to install the system launcher SimDock 1.3 (Linux)

- Struts2 Result Types (Programming)

- Use Ambari rapid deployment Hadoop big data environment (Server)

 
         
  Nginx Keepalived Nginx monitoring scripts
     
  Add Date : 2018-11-21      
         
         
         
 

Keepalived + nginx installation deployment
 
hosts: IP- > 10.252.3.160   nginx installed OK (omitted)
preparation machine: IP- > 10.252.3.161   nginx installed OK (omitted)
VIP: 10.252.3.162
 
The first step: AMB installed with keepalived    
yum installkeepalived – y
Step Two: configure /etc/keepalived/keepalived.conf
host 10.252.3.160 configured as follows:
configuration File for keepalived
global_defs {
  notification_email {!
      acassen@firewall.loc # for message destination
      failover@firewall.loc
      sysadmin@firewall.loc
 }
  notification_email_from root @ nginx2       # for message source address
  smtp_server 127.0.0.1               #smtp server
  smtp_connect_timeout 30
  router_id LVS_DEVEL
}
 
vrrp_scriptchk_http_port {
    script "/ data / script / nginx.sh "                  # monitoring service footsteps
    interval 2                     # detection interval (execution step interval)
    weight 2
}
 
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, and password must be the primary backup as
        auth_type PASS
        auth_pass 1234
   }
 
    track_interface {              # monitor card. If only monitoring service, where you can not fill
      eth1
   }
    track_script {                      # to script to monitor chk_http_port in front fill
        chk_http_port
   }
    virtual_ipaddress {  # switching mode. Switching Virtual IP
        10.252.3.165/24 dev eth1 label eth1: 1
   }
}
====== =============================================
Preparation configuration: 10.252.3.161
configuration File for keepalived
global_defs {
  notification_email {
      acassen@firewall.loc # for message destination address       failover@firewall.loc
      sysadmin@firewall.loc
 }
  notification_email_from root @ nginx2       # for message source address
  smtp_server 127.0.0.1               #smtp server
  smtp_connect_timeout 30
  router_id LVS_DEVEL
}
 
vrrp_scriptchk_http_port {
    script "/data/script/nginx.sh"                  # monitoring service footsteps
    interval 2                     # detection interval (execution step interval)
    weight 2
}
 
vrrp_instanceVI_1 {
    state bACKUP   the difference between the primary and secondary point #, logos
    interface eth1           # corresponding card
    virtual_router_id 60  
    priority 100     # priority, who call the shots (the greater the value, the priority level higher)
    advert_int 2
    authentication {    # authentication mode and password must be the primary backup as
        auth_type PASS
        auth_pass 1234
   }
 
    track_interface {              # monitor card. If only monitoring service, where you can not fill
      eth1
   }
    track_script {                      # to script to monitor chk_http_port in front fill
        chk_http_port
   }
    virtual_ipaddress {  # switching mode. Switching Virtual IP
        10.252.3.165/24 dev eth1 label eth1: 1
   }
}
The third step: write / data / script / nginx.sh script content
# / bin / sh
nginxPidNum = `ps-C nginx --no-header |! wc -l`
keepalivedPidNum =` ps-C keepalived --no-header | wc -l`
if [$ nginxPidNum -eq 0]; then
    killall keepalived
elif [$ keepalivedPidNum -eq 0]; then
    service keepalived start
fi
 
script permissions to chmod + x /data/script/nginx.sh
step Four: start standby keepalived
Servicekeepalived start
Ifconfig View eth1: 1 whether up. If you up, you can test. No self-commissioning.

     
         
         
         
  More:      
 
- Oracle Character Set Summary (Database)
- Ubuntu users to install household financial management tools HomeBank 5.0.0 (Linux)
- PostgreSQL 9.3.5 database installation under Ubuntu Server 14.04 (Database)
- Linux installation JDK1.6 rpm.bin assembly (Linux)
- How to choose the first programming language based on the life you want (Programming)
- ARP Linux-related operations (Linux)
- How to use the command line to obtain Freely RSS source on Linux (Linux)
- Use MongoDB C # MongoDB official driving operation (Database)
- How to fix Ubuntu / Mint can not add PPA source of error (Linux)
- Ubuntu install Oracle 10g process and problem solution (Linux)
- 20 Unix / Linux command skills (Linux)
- Top 10: HTML5, JavaScript 3D game engine and framework (Linux)
- Increase ssh security service under Linux (Linux)
- Hadoop 0.23 compile common errors (Server)
- Construction CA certificate using OpenSSL command line (Server)
- Grep how to find files based on file contents in UNIX (Linux)
- Python object-oriented programming (Programming)
- Several reasons MySQL garbled (Database)
- How to set up FTP server on Linux (Server)
- XenServer virtual machines installed in dual-card configuration (Server)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.