Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - CentOS 6.6 install rsync server (Server)

- Debian 7 and Debian 8 users how to install Oracle Java 8 (Linux)

- How to use the command line to obtain Freely RSS source on Linux (Linux)

- Ubuntu 15.04 and Ubuntu 14.04 installed Cinnamon 2.6 (Linux)

- CentOS / Linux install VNC Server (Linux)

- Ubuntu 12.04 configure NVIDIA CUDA 5.5 Record (Linux)

- Bash code injection attacks through a special environment variable (Linux)

- Command filter MySQL slow query log (Database)

- Linux Log File Browser --logrotate (Linux)

- MySQL multi-master multi-cluster deployment uses alive Galera (Database)

- Ordinary users how to use the firewall software (Linux)

- Install the latest Pinta graphics editing software on Ubuntu 14.04 (Linux)

- Hadoop1.2.1 plug compilation (Server)

- Jigsaw project will solve the problem of Java JAR hell Mody (Programming)

- Make Linux more secure server tips (Linux)

- Linux system security check method (Linux)

- Broadcom transplanted to OpenWrt summary (Programming)

- Use libcurl library download url image (Programming)

- Limit the use of the request being Nginx Flood attack (Linux)

- KVM installation under CentOS 5.5 (Linux)

 
         
  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:      
 
- Ubuntu uses under KVM + Qemu virtual machine build (Linux)
- Linux ls command (Linux)
- Linux System Getting Started Tutorial: Installing Git on Linux (Linux)
- VMware virtual machine operating system log Error in the RPC receive loop resolve (Linux)
- Ubuntu users install the Download Manager software Xdman 5.0 (Linux)
- The wrong in Linux: too many open files (Linux)
- Redis application of Sina Weibo (Database)
- VirtualBox installation enhancements let the mouse move and share CentOS 6.4 (Linux)
- Java, extends and implements Usage (Programming)
- Squid proxy server configuration under Linux (Server)
- Detailed Linux su command to switch users Mistakes (Linux)
- PostgreSQL vacuum principle of a function and parameters (Database)
- Java open source monitoring platform Zorka basic use (Linux)
- Use PuTTY key authentication mechanism for remote login Linux (Linux)
- Oracle LONG RAW BLOB CLOB type of presentation (Database)
- ARM Linux system call (Linux)
- Shilpa Nair interview experience sharing RedHat Linux package management (Linux)
- Linux package manager - yum (Linux)
- Python common data type summary (Programming)
- How Ubuntu Snappy Core 2 running on Raspberry Pi (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.