zoukankan      html  css  js  c++  java
  • 021_nginx动态upstream检查

    GET: 请求指定的页面信息,并返回实体主体。
    HEAD: 只请求页面的首部。

    #参考:http://tengine.taobao.org/document_cn/http_upstream_check_cn.html

    一、

    upstream anubis.web.base_backend {
        server bj-base-1.jyall.me:9000; 
        server bj-base-2.jyall.me:9000; 
        keepalive 512;
        check interval=1000 rise=2 fall=2 timeout=3000 type=http;
        check_http_send "HEAD / HTTP/1.1
    Connection: keep-alive
    
    ";  
        check_http_expect_alive http_2xx http_3xx http_4xx;
    }
    

    二、

    curl -d " 
        server bj-base-1.jyall.me:9000; 
        server bj-base-2.jyall.me:9000; 
    
        keepalive 512;
    
        check interval=1000 fall=3 rise=2 timeout=3000 default_down=false type=http;
        check_http_send 'GET / HTTP/1.1
    Connection: keep-alive
    Host: open-anubis.ele.me
    
    ';   #替代的配置check_keepalive_requests 100;
        check_http_expect_alive http_2xx http_3xx http_4xx;
    
    " 127.0.0.1:8866/upstream/open.jyall.me.web.base_backend

    返回"success"=>表示ok的

    三、

    curl 127.0.0.1:8866/up_status
    
    <tr>
    <td>4</td><td>open.jyall.me.web.base_backend</td> 
    <td>11.200.58.236:9000</td> <td>up</td> <td>215515</td> <td>0</td> 
    <td>http</td> <td>0</td> </tr> <tr>

    <td>5</td> <td>open.jyall.me.web.base_backend</td>
    <td>11.200.62.77:9000</td>
    <td>up</td>

    <td>215283</td> <td>0</td> <td>http</td> <td>0</td> </tr>

      

  • 相关阅读:
    Spring读书笔记
    window.open参数详解
    在spring security3上实现验证码
    Struts2.1 标签详细说明
    总结一下log4j
    【转】hibernate映射oracle自增长
    Java中四舍五入保留七位小数
    求三个整数的最小公倍数
    boxshadow 曲线阴影和翘边阴影
    <div> <p> <span>的用法和区别
  • 原文地址:https://www.cnblogs.com/itcomputer/p/8080416.html
Copyright © 2011-2022 走看看