本文转自:http://bbs.linuxtone.org/thread-19302-1-1.html
前言:
淘宝开源项目:Tengine 在2012.5.9更新1.2.5版本
- News
2.3. [05/09/2012] Tengine-1.2.5 is released (changes). - [03/30/2012] Tengine-1.2.4 is released (changes).
- [03/08/2012] We are writing an open book on Nginx development.
- [02/27/2012] Tengine-1.2.3 is released (changes).
- [01/11/2012] Tengine-1.2.2 is released (changes).
- [12/07/2011] We gave a talk on Hacking Nginx on Velocity China 2011.
- [12/06/2011] Tengine-1.2.1 is released (changes).
[12/02/2011] Tengine goes to open source.
变更信息:
Tengine-1.2.5 [2012-05-09]
今天刚好有时间,就升级并且测试了下upstream_check模块功能!
1.编译:(upstream_check模块)
- ./configure –user=www –group=www –add-module=../ngx_cache_purge-1.5 –add-module=../ngx-fancyindex –prefix=/usr/local/nginx/ –with-http_upstream_check_module –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module –with-md5=/usr/lib –with-sha1=/usr/lib
需要加入:–with-http_upstream_check_module 编译参数来添加upstream_check模块
2.配置
nginx.conf
- upstream linuxtone {
- server 127.0.0.1:81;
- server 127.0.0.1:82;
- check interval=3000 rise=2 fall=5 timeout=1000;
}
vhost:
location /nstatus {
3.查看:
URL: http://bbs.linuxtone.org/nstatus


说明:upstream_check会自动检测你upstream后端的app存活,规定检测次数内如果down,会移除出upstream。同样如果恢复会自动加到upstream。这个过程不需要人工重启nginx!
RT:如果有后端app down机,发邮件通知功能会更好!