nginx-upsync-module

基于 Nginx 实现动态配置的模块
授权协议 BSD
开发语言 C/C++
所属分类 服务器软件、 Nginx扩展模块
软件类型 开源软件
地区 国产
投 递 者 曾高杰
操作系统 跨平台
开源组织 新浪微博
适用人群 未知
 软件概览

nginx-upsync-module 是微博开源的一个基于 Nginx 实现动态配置的模块,通过拉取 Consul 或 etcd (及其它)的上游数据,实现无需重新加载 Nginx ,动态修改后端服务器属性(weight,max_fails,down ...)。

修改配置文件并重新启动 Nginx 可能并不总是很方便。 例如,当遇到大流量和高负载,重启 Nginx 并在此时重新加载配置会进一步增加系统负载,并可能暂时降低性能。使用 nginx-upsync-module 模块则可以在不影响性能的情况下,更加平滑的扩展和收缩。

nginx-consul:

http {
    upstream test {
        upsync 127.0.0.1:8500/v1/kv/upstreams/test/ upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
        upsync_dump_path /usr/local/nginx/conf/servers/servers_test.conf;

        include /usr/local/nginx/conf/servers/servers_test.conf;
    }

    upstream bar {
        server 127.0.0.1:8090 weight=1 fail_timeout=10 max_fails=3;
    }

    server {
        listen 8080;

        location = /proxy_test {
            proxy_pass http://test;
        }

        location = /bar {
            proxy_pass http://bar;
        }

        location = /upstream_show {
            upstream_show;
        }

    }
}

nginx-etcd:

http {
    upstream test {
        upsync 127.0.0.1:2379/v2/keys/upstreams/test upsync_timeout=6m upsync_interval=500ms upsync_type=etcd strong_dependency=off;
        upsync_dump_path /usr/local/nginx/conf/servers/servers_test.conf;

        include /usr/local/nginx/conf/servers/servers_test.conf;
    }

    upstream bar {
        server 127.0.0.1:8090 weight=1 fail_timeout=10 max_fails=3;
    }

    server {
        listen 8080;

        location = /proxy_test {
            proxy_pass http://test;
        }

        location = /bar {
            proxy_pass http://bar;
        }

        location = /upstream_show {
            upstream_show;
        }

    }
}
  • 模块微博开源:https://github.com/weibocom/nginx-upsync-module#upsync 实现方案: nginx+consul nginx+etcd   Installation wget 'http://nginx.org/download/nginx-1.8.0.tar.gz' tar -xzvf nginx-1.8.0.tar.gz cd nginx-1.8

  • http://blog.csdn.net/yueguanghaidao/article/details/11274737 http://mp.weixin.qq.com/s?__biz=MzAwMDU1MTE1OQ==&mid=404151075&idx=1&sn=5f3b8c007981a2d048766f808f8c8c98&scene=2&srcid=0223XScbJrOv7noogVX6

  • nginx-upsync-module使用 编译模块到nginx 安装nginx依赖以及其他工具 apt-get install git apt-get build-dep nginx 下载nginx-upsync-module源码 git clone https://github.com/weibocom/nginx-upsync-module.git 下载nginx源码 wget 'http

  • 针对我在编译在两个模块的过程中遇到的一系列问题,特此记录编译流程的一些细节 1、下载 install git git clone https://github.com/weibocom/nginx-upsync-module.git git clone https://github.com/xiaokai-wang/nginx_upstream_check_module 必须使用这个地址的模块,否

  • 一、前言 各组件介绍及安装请转阅: nginx + etcd 动态负载均衡实践(一)—— 组件介绍 nginx + etcd 动态负载均衡实践(二)—— 组件安装 二、下载upsync 模块 mkdir -p /root/nginx-etcd-confd cd /root/nginx-etcd-confd git clone https://github.com/weibocom/nginx-up

  • 简介 nginx-upsync-module 提供了动态的负载均衡, 动态更新上游的服务器不需要 reload nginx , 它的功能是拉取 consul 的后端 server 的列表, 并更新Nginx 的路由信息。 此模块不依赖于任何第三方模块。 consul 作为 Nginx 的 db, 利用 consul 的 KV 服务, 每个 Nginx work 进程独立的去拉取各个upstream

 相关资料
  • Nginx-Stream-UpSync-Module 是基于nginx四层TCP协议的弹性扩缩容方案,实现性能无损的扩容缩容: 当前模块支持etcd 和 consul,相关配置如下: nginx-etcd: stream {    upstream test {        # fake server otherwise ngx_stream_upstream will report error

  • 本文向大家介绍基于Nginx的Mencached缓存配置详解,包括了基于Nginx的Mencached缓存配置详解的使用技巧和注意事项,需要的朋友参考一下 简介 memcached是一套分布式的高速缓存系统,memcached缺乏认证以及安全管制,这代表应该将memcached服务器放置在防火墙后。memcached的API使用三十二比特的循环冗余校验(CRC-32)计算键值后,将数据分散在不同的

  • 本文向大家介绍Nginx安装lua-nginx-module模块的方法步骤,包括了Nginx安装lua-nginx-module模块的方法步骤的使用技巧和注意事项,需要的朋友参考一下 ngx_lua_module 是一个nginx http模块,它把 lua 解析器内嵌到 nginx,用来解析并执行lua 语言编写的网页后台脚本 特性很牛叉,可自行百度查看,这里主要是示范一下,如何在Nginx下安

  • This module adds cross-site AJAX support to nginx. Currently only cross-site GET is supported. The cross-site GET is currently implemented as JSONP (or "JSON with padding"). See http://en.wikipedia.or

  • This module provides a transparent caching layer for arbitrary nginx locations (like those use an upstream or even serve static disk files). Usually, the Memc Nginx Module is used together with this m

  • This is an Nginx upstream module that makes nginx talk to a redis 2.x server in a non-blocking way. The full Redis 2.0 unified protocol has been implemented including the redis pipelining support. Thi