<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                健康狀態檢測案例: 1)安裝nginx_upstream_check_module模塊模塊 [root@proxy01 opt]# git clone https://github.com/yaoweibin/nginx_upstream_check_module.git 或者 http://soft.51yuki.cn/nginx_upstream_check_module-master.zip 2)nginx加載該模塊 [root@proxy01 nginx-1.9.2]# patch -p1 < /opt/nginx_upstream_check_module/check_1.9.2+.patch [root@proxy01 nginx-1.9.2]# ./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --error-log-path=/var/log/nginx/error_log --http-log-path=/var/log/nginx/access_log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_ssl_module --with-http_stub_status_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --add-module=/opt/ngx_cache_purge-master --add-module=/usr/local/src/nginx-upstream-fair --add-module=/opt/nginx-sticky-module-ng/ --add-module=/opt/nginx_upstream_check_module/ && make^C [root@proxy01 nginx-1.9.2]# cp objs/nginx /usr/local/nginx/sbin/ cp: overwrite `/usr/local/nginx/sbin/nginx'? y [root@proxy01 nginx-1.9.2]# /usr/local/nginx/sbin/nginx 參數: - interval:向后端發送的健康檢查包的間隔。 - fall(fall_count): 如果連續失敗次數達到fall_count,服務器就被認為是down。 - rise(rise_count): 如果連續成功次數達到rise_count,服務器就被認為是up。 - timeout: 后端健康請求的超時時間。 - - type:健康檢查包的類型,現在支持以下多種類型 - tcp:簡單的tcp連接,如果連接成功,就說明后端正常。 - ssl_hello:發送一個初始的SSL hello包并接受服務器的SSL hello包。 - http:發送HTTP請求,通過后端的回復包的狀態來判斷后端是否存活。 - mysql: 向mysql服務器連接,通過接收服務器的greeting包來判斷后端是否存活。 - ajp:向后端發送AJP協議的Cping包,通過接收Cpong包來判斷后端是否存活。 - port: 指定后端服務器的檢查端口。你可以指定不同于真實服務的后端服務器的端口,比如后端提供的是443端口的應用,你可以去檢查80端口的狀態來判斷后端健康狀況。默認是0,表示跟后端server提供真實服務的端口一樣。該選項出現于Tengine-1.4.0。 check_http_expect_alive 這些狀態碼指示上游服務器的http 響應是可以的,后端是活著的。 check_http_send default: *"GET / HTTP/1.0\r\n\r\n"* https://github.com/yaoweibin/nginx_upstream_check_module 案例: upstream StaticServer { server 10.100.100.105:80; server 10.100.100.104:80; check interval=5000 rise=1 fall=3 timeout=4000; #check_http_send "HEAD /status HTTP/1.1\r\n\r\n"; } server { listen 80; server_name test.51yuki.cn; #charset koi8-r; #access_log logs/host.access.log main; location / { proxy_pass http://StaticServer; } location /status { check_status; #access_log off; allow 10.100.100.0/24; deny all; } 案例2: http { include mime.types; default_type application/octet-stream; #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; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; upstream server { server 10.2.11.233:80; server 10.2.11.232:80; check interval=5000 rise=2 fall=3 timeout=5000 type=http; check_http_send "HEAD /health.html HTTP/1.0\r\n\r\n"; } server { listen 80; server_name test.a.com; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.html index.htm; } location /bbs { proxy_pass http://server/bbs; proxy_set_header host $Host; } location /status { check_status; access_log off; allow 10.2.18.0/24; deny all; } ![](https://box.kancloud.cn/139269b051bf66d5c246492df6f7840b_806x325.png) 模擬后端服務器node2,故障 [root@node2 html]# service httpd stop Stopping httpd: [ OK ] 然后在查看 ![](https://box.kancloud.cn/bcbaf16ad1804418b9907aa7a622e223_812x317.png) 注意: 后端服務器是http,讓其不記錄對/health.html的訪問日志 [root@node2 conf]# vim httpd.conf SetEnvIf Remote_Addr "10\.2\.11\.207" dontlog SetEnvIf Remote_URL "^/health\.html$" dontlog CustomLog logs/access_log combined env=!dontlog 然后重啟http服務器
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看