日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 运维知识 > Nginx >内容正文

Nginx

Nginx负载均衡监控节点状态

發(fā)布時(shí)間:2025/4/9 Nginx 67 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Nginx负载均衡监控节点状态 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

  利用第三方插件監(jiān)控(淘寶開發(fā)的Tengine)

模塊:nginx_upstream_check_module

實(shí)現(xiàn)web界面

?

下載補(bǔ)丁包

wget https://codeload.github.com/yaoweibin/nginx_upstream_check_module/zip/master

解壓縮

unzip master?

drwxr-xr-x 6 root root ? 4096 11月 10 18:58 nginx_upstream_check_module-master

cd nginx-1.6.3

打補(bǔ)丁

patch -p1 <../nginx_upstream_check_module-master/check_1.5.12+.patch
patching file src/http/modules/ngx_http_upstream_ip_hash_module.c
patching file src/http/modules/ngx_http_upstream_least_conn_module.c
patching file src/http/ngx_http_upstream_round_robin.c
patching file src/http/ngx_http_upstream_round_robin.h

重新編譯(最好先備份一下之間的配置文件)

?./configure --prefix=/application/nginx-1.6.3 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --add-module=../nginx_upstream_check_module-master/

make

(如果新的nginx就makeinstall ? ?如果不是新的nginx,就不用makeinstall了)

把之前nginx啟動(dòng)文件里的文件備份一下

mv /application/nginx/sbin/nginx{,.bak}

將補(bǔ)丁的nginx二進(jìn)制文件復(fù)制到/application/nginx/sbin/

cp ./objs/nginx /application/nginx/sbin/

?/application/nginx/sbin/nginx -t ?

/application/nginx/sbin/nginx -s reload

檢查模塊

/application/nginx/sbin/nginx -V
nginx version: nginx/1.6.3
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC)
TLS SNI support enabled
configure arguments: --prefix=/application/nginx-1.6.3 --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --add-module=../nginx_upstream_check_module-master/

?

添加一個(gè)參數(shù)

vim /application/nginx/conf/nginx.conf

在每一個(gè)upstream里添加一行

upstream android_pools {
server 192.168.70.127:80 weight=1; #apache
check interval=3000 rise=2 fall=5 timeout=1000 type=http;

#interval ?3秒檢查

#rise ?宕機(jī)請(qǐng)求2次,好了加進(jìn)來

#fall ? 宕機(jī)壞了 請(qǐng)求5次,還不行提出

#timeout ?超時(shí)一秒
}

?

在server里添加

location /status {
check_status;
access_log off;
}

?

訪問網(wǎng)址

192.168.70.131

Name ?節(jié)點(diǎn)

status ?狀態(tài)

Rise ?宕機(jī)啟動(dòng)次數(shù)

fall 宕機(jī)次數(shù)

check type 檢查類型

check ?prot ?端口

轉(zhuǎn)載于:https://www.cnblogs.com/sky00747/p/8656316.html

總結(jié)

以上是生活随笔為你收集整理的Nginx负载均衡监控节点状态的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。