一、参考Tengine   http://tengine.taobao.org/document_cn/http_dyups_cn.html

ngx_http_dyups_module

Description

This module can be used to update your upstream-list without reloadding Nginx.

TODO:

It can not work with common `nginx_upstream_check_module`.

Compilation

The module is not compiled into Tengine by default. It can be enabled with '--with-http_dyups_module'
configuration parameter, and enabled lua support with '--with-http_dyups_lua_api'.
But it can not be compiled as a '.so'.

二、配置
在http块中引用如下的配置=>
http {
dyups_upstream_conf upstream/ngconf_dyups.conf;
include upstream/ngconf_dyups.conf; #假如已经include进来的话就不需要include了;eg: include upstream/*.conf;
} cat upstream/ngconf_dyups.conf server {
listen 8866;
location / {
dyups_interface; #you should add the directive dyups_interface into your config file to active this feature
}
}
三、restful interface常用操作。
<1>curl -H "host: dyhost" 127.0.0.1:8866/detail        #获取所有的upstream和他们的后端server
xxx-svr-backend
server 10.103.101.169:8080
server 10.103.104.207:8080 xxx-admin-backend
server 10.103.105.81:9001
server 10.103.105.80:9001 xxx-admin.alta.jyall.me.alta1-hg-xxx-admin
server 10.103.105.81:9001
server 10.103.105.80:9001 xxx.alta.jyall.me.alta1-hg-xxx-proxy
server 10.103.101.169:8080
server 10.103.104.207:8080

<2>curl -H "host: dyhost" 127.0.0.1:8866/list      #获取upstream的名称列表

xxx-svr-backend
xxx-admin-backend
xxx-admin.alta.jyall.me.alta1-hg-xxx-admin
xxx.alta.jyall.me.alta1-hg-xxx-proxy

<3>curl -H "host: dyhost" 127.0.0.1:8866/upstream/xxx-svr-backend        #根据upstream的名字找出它后端的server列表

server 10.103.101.169:8080
server 10.103.104.207:8080

<4>添加或更新一个upstream

curl -d "server 127.0.0.1:8089;server 127.0.0.1:8088;" 127.0.0.1:8866/upstream/arun_test

curl -d "server 127.0.0.1:9000;server 127.0.0.1:8088;" 127.0.0.1:8866/upstream/arun_test

curl -H "host: dyhost" 127.0.0.1:8866/upstream/arun_test

server 127.0.0.1:9000
server 127.0.0.1:8088

<5>curl 127.0.0.1:8866/detail

arun_test
server 127.0.0.1:9000
server 127.0.0.1:8088

<6>curl -i -X DELETE 127.0.0.1:8866/upstream/arun_test    #动态删除upstream

HTTP/1.1 200 OK
Date: Wed, 16 Aug 2017 12:05:58 GMT
Content-Length: 7
Connection: keep-alive success

curl 127.0.0.1:8866/detail再次查看"arun_test"的upstream已经被删除了。

-------------------------------------------------------------------------ngx_http_upstream_check_module--------------------------------------------------------------------------------

四、upstream检查模块。

http://tengine.taobao.org/document_cn/http_upstream_check_cn.html

006_nginx动态upstream和安全检查模块的更多相关文章

  1. Windows应急响应和系统加固(2)——Windows应急响应的命令使用和安全检查分析

    Windows应急响应的命令使用和安全检查分析 1.获取IP地址: ·ipconfig /all,获取Windows主机IP地址信息: ·ipconfig /release,释放网络IP位置: ·ip ...

  2. 7、nginx的upstream及fastcgi模块应用

    ngx_http_proxy_module, ngx_http_upstream_module   ngx_http_proxy_module:实现反向代理及缓存功能 proxy_pass http: ...

  3. DSO动态加载PHP模块到Apache服务器

    PHP在Linux/Unix平台上经常与Apache搭配使用,在安装PHP时,有三种安装方式可供选择:静态模式.动态模式(DSO).CGI二进制模式. 由于易于维护和升级,我强烈建议以DSO方式安装P ...

  4. 动态编译添加php模块

    注意:转载请注明出处:http://www.programfish.com/blog/?p=85 在很多时候我们用linux里搭建web服务器的时候会需要编译安装php套件,而在编译安装后可能又会需要 ...

  5. saltstack主机管理项目:动态调用插件解析-模块解析(五)

    一.动态调用插件解析 1.目录结构 1.base_module代码解析: def syntax_parser(self,section_name,mod_name,mod_data): print(& ...

  6. Angular中懒加载一个模块并动态创建显示该模块下声明的组件

    angular中支持可以通过路由来懒加载某些页面模块已达到减少首屏尺寸, 提高首屏加载速度的目的. 但是这种通过路由的方式有时候是无法满足需求的. 比如, 点击一个按钮后显示一行工具栏, 这个工具栏组 ...

  7. 021_nginx动态upstream检查

    GET: 请求指定的页面信息,并返回实体主体.HEAD: 只请求页面的首部. #参考:http://tengine.taobao.org/document_cn/http_upstream_check ...

  8. Nginx的配置与部署研究,Upstream负载均衡模块

    Nginx 的 HttpUpstreamModule 提供对后端(backend)服务器的简单负载均衡.一个最简单的 upstream 写法如下: upstream backend { server ...

  9. 高性能Web服务器Nginx的配置与部署研究(15)Upstream负载均衡模块

    Nginx 的 HttpUpstreamModule 提供对后端(backend)服务器的简单负载均衡.一个最简单的 upstream 写法如下: server backend1.example.co ...

随机推荐

  1. intent 几种用法

    Intent 应该算是Android中特有的东西.你可以在Intent中指定程序 要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料.都指定好后,只要调用start ...

  2. P2569 [SCOI2010]股票交易

    最近 \(lxhgww\) 又迷上了投资股票,通过一段时间的观察和学习,他总结出了股票行情的一些规律. 通过一段时间的观察,\(lxhgww\) 预测到了未来 \(T\) 天内某只股票的走势,第 \( ...

  3. Spring_bean的实例化时机

    前言:创建Java对象 public class User { private String name; private Integer age; public User() { System.out ...

  4. reids的主从复制配置

    本博来简单介绍一下redsi的主从配置.意思就是说有一台主redis,一个从redis,你向主的redis里面写一个数据,然后会同步到从redis里面.注意:从redis 不能写入数据.所以当我们用到 ...

  5. C#中子线程操作主线程中窗体上控件的方法

    Demo this.listView1.Visible = true; this.listView1.BeginUpdate();this.listView1.EndUpdate(); //结束数据处 ...

  6. POJ - 3279 Fliptile (枚举)

    http://poj.org/problem?id=3279 题意 一个m*n的01矩阵,每次翻转(x,y),那么它上下左右以及本身就会0变1,1变0,问把矩阵变成全0的,最小需要点击多少步,并输出最 ...

  7. FZU 2254 英语考试

    在过三个礼拜,YellowStar有一场专业英语考试,因此它必须着手开始复习. 这天,YellowStar准备了n个需要背的单词,每个单词的长度均为m. YellowSatr准备采用联想记忆法来背诵这 ...

  8. HDU - 5413 CRB and Roads

    CRB and Roads Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) ...

  9. 通过lua栈了解lua与c的交互

    lua是如何执行的 其中分析.执行部分都是c语言实现的. lua与c的关系 lua的虚拟机是用c语言实现的,换句话说一段lua指令最终在执行时都是当作c语言来执行的,lua的global表,函数调用栈 ...

  10. bootstrap中模态框的使用

    1.代码: <%--登录模态框--%> <li><a href="#" data-toggle="modal" data-targ ...