Ngx-dyups是什么,能干什么nginx
它是一个Nginx第三方动态Upstream配置模块,能够实如今不重启Nginx状况下动态更新反向代理Upstream表。该模块由淘宝开发团队维护,淘宝自家的Tengine中虽然没有直接集成该模块,但能够经过从新编译方式加进去。git
源码地址github
https://github.com/yzprofile/ngx_http_dyups_moduleredis
Ngx-dyups安装 json
一、下载第三方模块session
git clone git://github.com/yzprofile/ngx_http_dyups_module.gitxss
二、将第三方模块目录复制到最初Openresty下载解压缩目录下,固然,也能够放到任意目录下,只是这样编译时须要指定该目录。ui
[test@P-SH-Nginx-01 ~]$ cp -r ngx_http_dyups_module openresty-1.11.2.5lua
第一次就由于没作这一步复制,最后报错以下spa
adding module in /home/test/openresty-1.11.2.5/ngx_http_dyups_module
./configure: error: no /home/test/openresty-1.11.2.5/ngx_http_dyups_module/config was found
ERROR: failed to run command: sh ./configure --prefix=/usr/local/openresty/nginx \...
三、切换到Openresty最初下载解压缩目录下
[test@P-SH-Nginx-01]$ cd openresty-1.11.2.5
四、以管理员身份执行./configure --add-module,注意,必须以管理员身份,这个从新编译过程很是长
[test@P-SH-Nginx-01 openresty-1.11.2.5]$ sudo ./configure --add-module=./ngx_http_dyups_module
编译过程当中会不停刷屏显示各类命令,均可以无视,但必定要注意最后的部分
…
adding module in ../rds-csv-nginx-module-0.07
+ ngx_http_rds_csv_filter_module was configured
adding module in /home/test/openresty-1.11.2.5/ngx_http_dyups_module
+ dyups module support lua
+ ngx_http_dyups_module was configured 这一句很关键,表示安装成功了
checking for PCRE library ... found
checking for PCRE JIT support ... found
…
五、以管理员身份执行make
[test@P-SH-Nginx-01 openresty-1.11.2.5]$ sudo make
六、若是Nginx进程仍启动中,则先关闭Nginx进程
七、切换到Make好的新文件所在目录
[test@P-SH-Nginx-01 openresty-1.11.2.5]$ cd build
[test@P-SH-Nginx-01 build]$ cd nginx-1.11.2
[test@P-SH-Nginx-01 nginx-1.11.2]$ cd objs
八、查看Nginx是否关闭了
[test@P-SH-Nginx-01 objs]$ ps -ef |grep nginx
test 98103 77025 0 05:35 pts/0 00:00:00 grep --color=auto nginx
九、将新的Nginx文件复制到目标目录
[test@P-SH-Nginx-01 objs]$ cp nginx /usr/local/openresty/nginx/sbin/
十、启动Nginx并查看是否新Module加进去了
[test@P-SH-Nginx-01 openresty]$ sudo ./nginx/sbin/nginx -c conf/nginx.conf
[test@P-SH-Nginx-01 openresty]$ sudo ./nginx/sbin/nginx -V
nginx version: openresty/1.11.2.5
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC)
built with OpenSSL 1.0.2k-fips 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt=-O2 --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.05 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.31 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.06 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.10 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.32 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.18 --add-module=../redis2-nginx-module-0.14 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.14 --add-module=../rds-csv-nginx-module-0.07 --with-ld-opt=-Wl,-rpath,/usr/local/openresty/luajit/lib --add-module=/home/test/openresty-1.11.2.5/ngx_http_dyups_module --with-http_ssl_module