Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - LAN in Ubuntu shared folders to Windows (Linux)

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

- Linux system crash (no such file or directory) How to rescue database (Linux)

- Install VLC player on Ubuntu 14.10 (Linux)

- MultiWriter: while the ISO image concurrent writes 20 USB Startup Disk (Linux)

- Four Methods of Self - Learning Linux (Linux)

- Steps to build MPICH2 development environment on CentOS 6.4 (Linux)

- JavaScript function definition mode (Programming)

- Linux start the process (Linux)

- Servlet life cycle code examples (Programming)

- Seven Steps to Help Google Chrome Speed - (Linux)

- How to install PlayOnLinux 4.2.5 under Ubuntu 14.04 / 12.04 (Linux)

- Fedora 8 configured Heartbeat (Linux)

- Installation Android IDE development tools, Android Studio 1.5 under Ubuntu (Linux)

- Linux system security configuration Collection (Linux)

- Java data structures - order linear form of table ArrayList (Programming)

- Selection sort, insertion sort, and Shell sort (Programming)

- Simple RPM package production (Linux)

- Shutdown - an advanced shutdown artifact (Linux)

- Linux / Unix system-level IO (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:      
 
- tcpdump Linux system security tools (Linux)
- How to monitor Nginx (Database)
- Character Encoding notes: ASCII, Unicode and UTF-8 (Linux)
- GoldenGate update is missing (Database)
- MySQL event table to achieve timing build a small note (Database)
- Use Ansible to bulk manage remote servers (Server)
- VMware virtual machine to use bridged mode fast Internet access (Linux)
- Ubuntu install Vendetta Online 14.04 (Linux)
- Extended VMware Ubuntu root partition size (Linux)
- Hibernate learning introductory tutorial (Programming)
- Linux Getting Started tutorial: Experience KVM Virtual Machine chapter (Linux)
- Oracle 11g forget approach SYS and SYSTEM password (Database)
- Zabbix installation and configuration process (Server)
- Spring JDBC Comments (Programming)
- CentOS How to mount the hard drive (Linux)
- Java implementation chain store binary tree (Programming)
- Oracle 12C with multi-column index (Database)
- Ubuntu install OpenMPI (Linux)
- Linux5 install MySQL 5.6 (RPM mode) (Database)
- RHEL7 unattended automatic installation DHCP + TFTP + SYSLINUX + TFTP + Kickstart (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.