nginx安裝healthcheck_nginx_upstreams檢測後端服務器狀態

 參考:https://github.com/yaoweibin/nginx_upstream_check_module

注:要根據之前編譯來重新編譯。

下載healthcheck_nginx_upstreams:見附件。

unzip nginx_upstream_check_module-master.zip 

這裏要注意下,用回源nginx-1.2.6包,否則會出錯。也就是確定之前沒有patch過源包

patch -p1 < ../nginx_upstream_check_module-master/check_1.2.6+.patch 

make 

make install

service nginx start

vi /etc/nginx/nginx.conf

在負載服務器下加入

check interval=3000 rise=2 fall=5 timeout=1000;

在server中加入

location /status {

                check_status;

                access_log   off;

                allow 10.1.230.35;

                deny all;
           }

service nginx restart

打開http://IP/status

會看到後端服務器的運行狀態。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章