Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - Node.js development environment deployment (Server)

- Nginx + Tomcat static and dynamic load balancing and separation configuration essentials under Linux (Server)

- Linux Network Analysis Tcpdump Command Guide (Linux)

- OGG-01496 OGG-01031 Error Resolution (Database)

- Linux how to view the graphics models notebook (Linux)

- S5PV210 development board for embedded development environment to build under Ubuntu (Linux)

- Linux Network Programming --TCP and UDP datagram type Explanation (Programming)

- OpenSSL: implementation creates a private CA, certificate signing request Explanation (Server)

- CentOS system dual network card IP information configuration (Linux)

- Amazon EC2 server using Rsync + Inotify real-time synchronization (Server)

- When the master key encounter NULL (Database)

- Vim Getting Started Tutorial (Linux)

- Oracle inline view updates problems encountered (Database)

- Oracle database on the hit rate of query summary (Database)

- CentOS7 install MySQL5.6.22 (Linux)

- Java Concurrency: synchronized (Programming)

- PostgreSQL Stream Configuration (Database)

- Ubuntu resolve sudo: source: command not found error (Linux)

- Big Data Common Glossary (Linux)

- Confrontation dragged Library - Web front-end encryption slow (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:      
 
- Linux System Getting Started Learning: DeVeDe installed on Linux to create a video DVD (Linux)
- How to use the command line to obtain Freely RSS source on Linux (Linux)
- Timeout control related to Python threads and a simple application (Programming)
- Using 30 seconds to write a detailed analysis of garbage removal system (Linux)
- Java memory model subclasses (Programming)
- A script to make your Ubuntu 14.04 Memory screen brightness (Linux)
- Use Vagrant up a local development environment tutorials (Server)
- Learning OpenCV: (VS2010-openCV2.4.3-win7 configuration instructions) (Linux)
- Installation Mate Desktop in FreeBSD 10.1 (Linux)
- Automate deployment of Docker-based Rails applications (Server)
- Oracle database on the hit rate of query summary (Database)
- Depth understanding of Python character set encoding (Programming)
- Boot-Repair Tool - repair of frequent start-up problems (Linux)
- VMware installed Linux system and JDK deployment (Linux)
- Analysis of memory mapping process in Linux x86-32 mode (Linux)
- Linux command -nohup & (Linux)
- How MAT Android application memory leak analysis (Programming)
- How to use GRUB2 files directly from the hard disk to run ISO (Linux)
- Linux asynchronous read documents by AIO (Programming)
- To share Linux script automatically change passwords (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.