Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - Ubuntu install Eclipse can not find JAVA_HOME problem (Linux)

- CentOS use wget (Linux)

- Using Java arrays implement sequential stack (Programming)

- A summary of Java multi-threaded programming - acquaintance multithreading (Programming)

- Linux system on how to use rsync to synchronize data (Server)

- How to use secure FTP file transfer (Server)

- To change CentOS7 runlevel (Linux)

- JavaScript Advanced Programming notes event capture and event bubbling (Programming)

- ld.so.conf.d profile (Linux)

- CentOS RedHat YUM Source Extensions Supplement (including 32-bit, 64-bit) (Linux)

- History and Statistics tuptime use tools to view Linux server system boot time (Server)

- Install Kali Linux via PXE network (Linux)

- Intrusion prevention network server security maintenance tips (Linux)

- How to update the Linux kernel to improve system performance (Linux)

- Python extension module Ganglia 3.1.x (Linux)

- Ubuntu 15.04 Linux install anti-virus software Antiviral 0.2 (Linux)

- Oracle 11gr2 new APPEND_VALUES tips (Database)

- Linux System Getting Started Learning: Disable Ubuntu Apport internal error reporting procedures (Linux)

- Mac Docker deploy development environment (Server)

- RHEL6.5 install the latest version of Vim and increase support for the Python2.7.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:      
 
- MySQL 5.6 database code changes (Database)
- Use Bosh deploy CloudFoundry problems encountered on OpenStack (Server)
- Ubuntu users to install Xtreme Download Manager (Linux)
- Linux modify the system time (Linux)
- Ubuntu 14.10 How to install office suite Calligra Suite 2.8.7 (Linux)
- MongoDB study notes - polymerization (Database)
- Java programmers talk about those advanced knowledge and direction (Programming)
- Ubuntu Install OpenSSL (Linux)
- Vi syntax highlighting settings (Linux)
- Increase ssh security service under Linux (Linux)
- Redis-- persistence articles (Database)
- Various sorting algorithms implemented in Python (Programming)
- Creating and extracting archives 11 tar command examples in Linux (Linux)
- Forbid screen change the window size when creating a new window under CentOS (Linux)
- SQLite3 simple operation (Database)
- Android Qemu GPS module (Programming)
- Oracle 11g modify MEMORY_TARGET (Database)
- How to upgrade Docker 1.6 on Fedora / CentOS (Server)
- To compile and install OpenCV-2.3.1 FFmpeg-2.1.2 under CentOS (Linux)
- The principle Httpclient4.4 (HttpClient Interface) (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.