标签:1.2 状态 lse remote ror 监测 pre 1.3 timeout
1、监测负载均衡节点作用用于提供主动式后端服务器健康检查,通过它可以检测后端realserver的健康状态,如果后端realserver不可用,则所有的请求就不会转发到该节点上。
编译安装方法:
./configure xxxxxxxxxxxxxxx --add-module=/app/software/nginx_upstream_check_module-master/
备注:可直接使用淘宝团队开发的NGINX程序包
http://tengine.taobao.org/download_cn.html
worker_processes 1;
events {
worker_connections 1024;
}
error_log logs/error.log;
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
log_format main ‘$remote_addr - $remote_user [$time_local] "$request" ‘
‘$status $body_bytes_sent "$http_referer" ‘
‘"$http_user_agent" "$http_x_forwarded_for"‘;
access_log logs/access.log main;
upstream server_pools {
server 10.3.151.34:81;
server 10.3.151.246:81;
check interval=3000 rise=2 fall=5 timeout=1000;
#对server_pools这个负载均衡条目中的所有节点,每隔3秒检测一次,请求2次正常则标记为realserver状态为UP,如果检查5次都失败,则标记realserver的状态为down,超时时间为1秒,检查的协议是HTTP。
}
server {
listen 80;
server_name www.kang.com;
location / {
proxy_pass http://server_pools;
}
location /status { #定义状态路径
check_status ;
access_log off;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 81;
server_name www.kang.com;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
#include vhost/*.conf;
}
正常状态:
异常状态:
标签:1.2 状态 lse remote ror 监测 pre 1.3 timeout
原文地址:http://blog.51cto.com/12965094/2148732