Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - MySQL High Availability plan several options (Database)

- Java multi-threaded shared communications variables (Programming)

- Encrypted with GnuPG signature to verify the authenticity and integrity of downloaded file (Linux)

- Oracle archive log size than the size of the online journal of the much smaller (Database)

- Installation GitLab appears ruby_block supervise_redis_sleep action run (Linux)

- What Java 8 fastest garbage collector (Programming)

- Mac OS X system setup Google Go language development environment configuration tool Sublime Text 2 (Linux)

- Python developer of time-saving method (Programming)

- Docker + Nginx + Tomcat7 simple load balancing configuration (Server)

- RedHat yum configuration and the prompt (Linux)

- Linux Variable content removal and replacement (Linux)

- Linux system security knowledge (Linux)

- CentOS yum source configuration (Linux)

- About Auto Layout and frame (Programming)

- How to use the command line ftp upload and download files (Linux)

- Mac OS X systems create Ubuntu USB boot disk for the Mac (Linux)

- Golang environment configuration recommendations (Linux)

- Java framework for parallel study - ForkJoin (Programming)

- Ubuntu install Lighttpd + Mono support .net (Linux)

- Import and export myloader accelerate mydumper (Database)

 
         
  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:      
 
- Open SSH remote access service that allows Android phone Ubuntu 14.04 (Linux)
- Java and Python use make way dictionary word search script (Programming)
- Oracle set and remove columns unavailable (Database)
- Use mysqldump MySQL database backup - Linux Shell Scripting (Database)
- Use IF NOT EXISTS create a data table (Database)
- Oracle online redefinition (Database)
- NAT and firewall under Linux (Linux)
- ASM learning overview (Database)
- Ceph Source Analysis: Network Module (Server)
- Smooth upgrade to OpenSSH 6.1 Procedure (Linux)
- JDK installation and configuration environment variable under linuxb (Linux)
- Recover accidentally deleted Nginx logs (Server)
- VMware virtual machine can not start VMnet0 no Internet access and other issues (Linux)
- Under CentOS yum install Nginx smooth switch mounted to Tengine (Server)
- Ubuntu cut screen method (Linux)
- Python when automated operation and maintenance often used method (Programming)
- Linux installation and configuration curl command tool (Linux)
- How to clear the v $ archived_log view expiration information (Database)
- Android in the event delivery and handling mechanism (Programming)
- Linux kernel socket protocol stack routing lookup cache mechanism (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.