Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Server \ Nginx Keepalived Nginx monitoring scripts     - Xmanager Remote Desktop login CentOS 6.5 (Linux)

- RHEL5.8 physical opportunities to Read-only file system (Linux)

- Oracle metadata Reconstruction experiments (Database)

- Install FFmpeg compiling from source in Mac OS X environment (Linux)

- Based shell: using read, the command-line script to achieve mass participation and input two integer calculation (Programming)

- Using Lua implement various operations list (Programming)

- Protection Docker container Notice (Server)

- Create, modify, delete users, user groups under linux (Linux)

- CentOS yum source configuration (Linux)

- xCAT error Unable to dispatch hierarchical sub-command to NORESOLUTION: 3001 (Linux)

- To install OwnCloud 7.0.4 under Ubuntu (Linux)

- How to use nmap command in Linux (Linux)

- How Linux system password security guarantee (Linux)

- Plasma 5.4 How to install on Kubuntu 15.04 (Linux)

- Intel Graphics Installer installation on Ubuntu 15.10 (Linux)

- CentOS 6.5 set under Oracle 12c at startup (Database)

- Five useful commands to manage file types and system time in linux (Linux)

- Remote installation of Net-SNMP whole process (Linux)

- Build the first ASP.NET 5 Web project in Mac OS X Yosemite 10.10.3 (Server)

- Comparison of one-time transaction and CTE insert data (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:      
 
- Spring classic face questions Share (Programming)
- Java Foundation - Getting Start (Programming)
- Linux, Apache Web site security settings (Linux)
- How screenshots from the Linux command line (Linux)
- Linux --- manual release system cache (Linux)
- CentOS / Linux restart active NIC connection paths / network configure error Error Resolution (Linux)
- On the PC goes heavy security watch your startup items (Linux)
- Oracle 11G R2 DataGuard structures (Database)
- Android Notification (Programming)
- Linux firewall rules example Extracts (Linux)
- After restarting network services, DNS address failure (Linux)
- crontab cause CPU exception Analysis and Processing (Linux)
- Linux System Getting Started Tutorial: Using the Linux common commands (Linux)
- Linux garbled file delete method (Linux)
- Linux kernel compilation, the configuration of the motor drive (Programming)
- Oracle archive log full cause abnormal slow database performance (Database)
- Iptables principle (Linux)
- A summary of Java multi-threaded programming - acquaintance multithreading (Programming)
- How do I upgrade from Ubuntu 15.04 to Ubuntu 15.10 (Linux)
- Interesting example of Linux Sort command (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.