Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - Python object-oriented programming (Programming)

- MBR partitions under Linux (Linux)

- Java concurrent programming combat (using synchronized synchronization method) (Programming)

- After Oracle 11g dataguard failover rebuild the archive logs are not applied to be NO problem (Database)

- Log4j configuration file Explanation (Linux)

- Python uses multi-process pool (Programming)

- Java code JIT compiler-friendly Mody (Programming)

- Use scripts easily install the latest Linux kernel in Ubuntu (Linux)

- The formatted Linux hard drive and mount (Linux)

- Ubuntu 14.04 Configuring cuda-convnet (Linux)

- Ubuntu 14.10 install KDE Plasma 5.2 (Linux)

- CoreOS quick installation to get started on a PC (Linux)

- Eclipse distributed management using GitHub project development (Linux)

- SQL MySQL query table duplicate data (Database)

- Swift rewrite initialize method of navigation controller class (Programming)

- Nginx server load balancing dual-system availability (Server)

- Java Timer (regular calling, to achieve a fixed time to perform) (Programming)

- MongoDB data replication and data slices (Database)

- Those things packaged using Gradle to Android (Programming)

- Use UDEV SCSI Rules configured ASM on Oracle Linux 5 and 6 (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:      
 
- Postfix mail service system principle and configuration (Linux)
- Use apt-p2p up a local Debian package cache (Server)
- Programmer editor Vim (Linux)
- Windows7 system using Vagrant to build Linux virtualized development environment (Linux)
- sudoers file parsing (Linux)
- To compile install and test Swift under Linux (Linux)
- Linux, MySQL root privilege escalation another method (Linux)
- Start Linux ISO image directly from the hard disk (Linux)
- Java enum use (Programming)
- How to fix Ubuntu / Mint can not add PPA source of error (Linux)
- Processor in protected mode of protection (Linux)
- The relationship between UNIX and Linux (Linux)
- Redis master-slave replication switch (Database)
- Solve the compatibility problem between Linux and Java at the source in bold font (Linux)
- Make Windows boot disk to install USB in Ubuntu Linux (Linux)
- ORA-28000 the account is locked fault simulation (Database)
- Restore database fault encountered ORA-0600 (Database)
- Linux operating system set up to effectively prevent ARP attacks (Linux)
- Android using SVG vector graphics to create cool animation effects (Programming)
- Java threads in the life cycle (Programming)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.