一、参考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. Red Hat 6.3 下安装 nginx-1.7.4

    一.安装准备 在Redhat系统下,没有CentOS那样使用yum安装依赖包等,所以接下来主要记录一下如何一步一步安装Nginx相关的依赖库. 下面就正式安装,由于安装Nginx需要依赖gcc-c++ ...

  2. 【POJ3974】最长回文字串

    在这里采用的是哈希+二分的方法. 根据回文串的性质可知,可以将回文分成奇回文和偶回文分别进行处理. 对于奇回文来说,每次枚举的端点一定是重合的,因此只需计算出端点左右公共的长度是多少即可,因此二分的是 ...

  3. 多线程状态下调用SimpleDateFormat.format()抛出 ArrayIndexOutOfBoundsException 异常

    本来想在类的顶部设置一个 静态的SimpleDateFormat常量 public final static DateFormat dateFormatGMT = new SimpleDateForm ...

  4. react与fetch

    JavaScript 中的 ajax 很早之前就有一个诟病----复杂业务下的 callback 嵌套的问题.promise 正是 js 中解决这一问题的钥匙. 接下来我们在react项目中应用到的f ...

  5. plink, vcftool计算等位基因频率(allele frequency,vcf)

    计算等位基因频率有两种方式,第一种用vcftool计算: /path/to/vcftools --vcf file.vcf --freq --chr 1 --out filefreq 很简单的一个命令 ...

  6. 2018.10.2浪在ACM 集训队第二次测试赛

    2018.10.26 浪在ACM 集训队第二次测试赛 题目一览表 来源 考察知识点 A 1273 海港 NOIP 普及组 2016 差分数组+二分 B 1274 魔法阵     C 1267 金币   ...

  7. Educational Codeforces Round 42 (Rated for Div. 2) E. Byteland, Berland and Disputed Cities

    http://codeforces.com/contest/962/problem/E E. Byteland, Berland and Disputed Cities time limit per ...

  8. 单机安装ELK

    . 简介 1.1 介绍 ELK是三个开源工具组成,简单解释如下: Elasticsearch是个开源分布式搜索引擎,它的特点有:分布式,零配置,自动发现,索引自动分片,索引副本机制,restful风格 ...

  9. Java_Mybatis_注解代理写法

    Mybatis的开发方式其实有3种: 1. 原始Dao开发(就是把mapper接口.映射文件和实现类都一并开发) 2. xml代理(就是只实现mapper接口和映射文件) 3.注解代理(就是只实现ma ...

  10. 修改Linux Operating System的时间与时区

    修改Linux Operating System的时间与时区 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 有的小伙伴可能会遇到安装了linux系统后,尽管时区选择正确,也会发现系 ...