您的位置:首页 > 运维架构 > Nginx

021_nginx动态upstream检查

2017-12-21 14:30 344 查看
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\r\nConnection: keep-alive\r\n\r\n";
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\r\nConnection: keep-alive\r\nHost: open-anubis.ele.me\r\n\r\n';   #替代的配置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>


  
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐