Giter Site home page Giter Site logo

weibocom / nginx-upsync-module Goto Github PK

View Code? Open in Web Editor NEW
1.8K 1.8K 386.0 1.35 MB

For http protocol. nginx-upsync-module, sync upstreams from consul or etcd and so on, dynamiclly modify backend-servers attributes(weight, max_fails, down...), needn't reload nginx

C 83.67% Perl 16.33%

nginx-upsync-module's People

Contributors

akatrevorjay avatar bamanzi avatar callmefoxie avatar cherisher avatar cuishuang avatar davidwudv avatar dvershinin avatar fishgege avatar gfrankliu avatar knorby avatar kuaikuai avatar lyokha avatar msaf1980 avatar readmecritic avatar reatang avatar senthilkumarkj avatar seven-eleven avatar sorc1 avatar xiaokai-wang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nginx-upsync-module's Issues

Future for Nodes Managing

Hi ,@xaikai, as we know, nginx cluster servers for different services in the production, we may only config one or limitted upstreams at the beginning, but we need changed when ever only one service updating or the booming traffic.Do you think it is necessary to add a future to solve this situation?

Here is my plan:
Add an key-list struct like upstream struct in consul, as key for every nginx node ip, value for upstream, such as:
10.0.0.1: auth
10.0.0.1: remind
10.0.0.2: feed
it means the nginx node 10.0.0.1 servers for auth and remind service, and 10.0.0.2 servers for feed, and if more traffic of feed coming, we can add 10.0.0.1:feed to consul for rebalancing nginx load.

By the way, this issue is inspired by #45, @gfrankliu.

nginx errors for upsync

nginx error log:
2016/05/16 11:03:08 [error] 15506#0: upsync_recv: recv error with upsync_server: 192.168.56.101:8500
2016/05/16 11:08:21 [error] 15506#0: recv() failed (104: Connection reset by peer)
2016/05/16 11:08:21 [error] 15506#0: upsync_recv: recv error with upsync_server: 192.168.56.101:8500
2016/05/16 11:13:34 [error] 15506#0: recv() failed (104: Connection reset by peer)
2016/05/16 11:13:34 [error] 15506#0: upsync_recv: recv error with upsync_server: 192.168.56.101:8500
2016/05/16 11:14:54 [error] 15508#0: send() failed (104: Connection reset by peer)
2016/05/16 11:14:54 [error] 15508#0: upsync_send: send error with upsync_server: 192.168.56.101:8500
2016/05/16 11:24:20 [error] 15506#0: recv() failed (104: Connection reset by peer)
2016/05/16 11:24:20 [error] 15506#0: upsync_recv: recv error with upsync_server: 192.168.56.101:8500

how to avoiding these nginx errors

与nginx-upstream-check-module模块同时添加编译报错

报错内容

objs/ngx_modules.o \
-lpthread -lcrypt -lm -lpcre -lcrypto -lcrypto -lz
objs/addon/src/ngx_http_upsync_module.o: In function `ngx_http_upsync_add_peers':
/root/nginx/src/nginx-upsync-module/src/ngx_http_upsync_module.c:821: undefined reference to `ngx_http_upstream_check_add_dynamic_peer'
objs/addon/src/ngx_http_upsync_module.o: In function `ngx_http_upsync_del_peers':
/root/nginx/src/nginx-upsync-module/src/ngx_http_upsync_module.c:975: undefined reference to `ngx_http_upstream_check_delete_dynamic_peer'
collect2: error: ld returned 1 exit status
objs/Makefile:219: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/root/nginx/src/nginx-1.8.0'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

这个需要怎么做才能编译通过呀?

完整信息如下:

[root@localhost nginx-1.8.0]# patch -p1< /root/nginx/src/nginx_upstream_check_module/check_1.7.5+.patch
patching file src/http/modules/ngx_http_upstream_hash_module.c
Hunk #3 succeeded at 528 (offset 10 lines).
patching file src/http/modules/ngx_http_upstream_ip_hash_module.c
patching file src/http/modules/ngx_http_upstream_least_conn_module.c
patching file src/http/ngx_http_upstream_round_robin.c
patching file src/http/ngx_http_upstream_round_robin.h
[root@localhost nginx-1.8.0]# ./configure --add-module=//root/nginx/src/nginx_upstream_check_module --add-module=/root/nginx/src/nginx-upsync-module
checking for OS
 + Linux 4.2.3-300.fc23.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 5.3.1 20151207 (Red Hat 5.3.1-2) (GCC)
checking for gcc -pipe switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found
checking for crypt.h ... found
checking for Linux specific features
checking for epoll ... found
checking for EPOLLRDHUP ... found
checking for O_PATH ... found
checking for sendfile() ... found
checking for sendfile64() ... found
checking for sys/prctl.h ... found
checking for prctl(PR_SET_DUMPABLE) ... found
checking for sched_setaffinity() ... found
checking for crypt_r() ... found
checking for sys/vfs.h ... found
checking for nobody group ... found
checking for poll() ... found
checking for /dev/poll ... not found
checking for kqueue ... not found
checking for crypt() ... not found
checking for crypt() in libcrypt ... found
checking for F_READAHEAD ... not found
checking for posix_fadvise() ... found
checking for O_DIRECT ... found
checking for F_NOCACHE ... not found
checking for directio() ... not found
checking for statfs() ... found
checking for statvfs() ... found
checking for dlopen() ... not found
checking for dlopen() in libdl ... found
checking for sched_yield() ... found
checking for SO_SETFIB ... not found
checking for SO_ACCEPTFILTER ... not found
checking for TCP_DEFER_ACCEPT ... found
checking for TCP_KEEPIDLE ... found
checking for TCP_FASTOPEN ... found
checking for TCP_INFO ... found
checking for accept4() ... found
checking for eventfd() ... found
checking for int size ... 4 bytes
checking for long size ... 8 bytes
checking for long long size ... 8 bytes
checking for void * size ... 8 bytes
checking for uint64_t ... found
checking for sig_atomic_t ... found
checking for sig_atomic_t size ... 4 bytes
checking for socklen_t ... found
checking for in_addr_t ... found
checking for in_port_t ... found
checking for rlim_t ... found
checking for uintptr_t ... uintptr_t found
checking for system byte ordering ... little endian
checking for size_t size ... 8 bytes
checking for off_t size ... 8 bytes
checking for time_t size ... 8 bytes
checking for setproctitle() ... not found
checking for pread() ... found
checking for pwrite() ... found
checking for sys_nerr ... found
checking for localtime_r() ... found
checking for posix_memalign() ... found
checking for memalign() ... found
checking for mmap(MAP_ANON|MAP_SHARED) ... found
checking for mmap("/dev/zero", MAP_SHARED) ... found
checking for System V shared memory ... found
checking for POSIX semaphores ... not found
checking for POSIX semaphores in libpthread ... found
checking for struct msghdr.msg_control ... found
checking for ioctl(FIONBIO) ... found
checking for struct tm.tm_gmtoff ... found
checking for struct dirent.d_namlen ... not found
checking for struct dirent.d_type ... found
checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in //root/nginx/src/nginx_upstream_check_module
checking for ngx_http_upstream_check_module ... found
 + ngx_http_upstream_check_module was configured
adding module in /root/nginx/src/nginx-upsync-module
 + ngx_http_upsync_module was configured
checking for PCRE library ... found
checking for PCRE JIT support ... found
checking for md5 in system md library ... not found
checking for md5 in system md5 library ... not found
checking for md5 in system OpenSSL crypto library ... found
checking for sha1 in system md library ... not found
checking for sha1 in system OpenSSL crypto library ... found
checking for zlib library ... found
creating objs/Makefile

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + md5: using system crypto library
  + sha1: using system crypto library
  + using system zlib library

  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

[root@localhost nginx-1.8.0]# make
make -f objs/Makefile
make[1]: Entering directory '/root/nginx/src/nginx-1.8.0'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/nginx.o \
    src/core/nginx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_log.o \
    src/core/ngx_log.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_palloc.o \
    src/core/ngx_palloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_array.o \
    src/core/ngx_array.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_list.o \
    src/core/ngx_list.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_hash.o \
    src/core/ngx_hash.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_buf.o \
    src/core/ngx_buf.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_queue.o \
    src/core/ngx_queue.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_output_chain.o \
    src/core/ngx_output_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_string.o \
    src/core/ngx_string.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_parse.o \
    src/core/ngx_parse.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_inet.o \
    src/core/ngx_inet.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_file.o \
    src/core/ngx_file.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_crc32.o \
    src/core/ngx_crc32.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_murmurhash.o \
    src/core/ngx_murmurhash.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_md5.o \
    src/core/ngx_md5.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_rbtree.o \
    src/core/ngx_rbtree.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_radix_tree.o \
    src/core/ngx_radix_tree.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_slab.o \
    src/core/ngx_slab.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_times.o \
    src/core/ngx_times.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_shmtx.o \
    src/core/ngx_shmtx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_connection.o \
    src/core/ngx_connection.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_cycle.o \
    src/core/ngx_cycle.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_spinlock.o \
    src/core/ngx_spinlock.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_cpuinfo.o \
    src/core/ngx_cpuinfo.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_conf_file.o \
    src/core/ngx_conf_file.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_resolver.o \
    src/core/ngx_resolver.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_open_file_cache.o \
    src/core/ngx_open_file_cache.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_crypt.o \
    src/core/ngx_crypt.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_proxy_protocol.o \
    src/core/ngx_proxy_protocol.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_syslog.o \
    src/core/ngx_syslog.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/event/ngx_event.o \
    src/event/ngx_event.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/event/ngx_event_timer.o \
    src/event/ngx_event_timer.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/event/ngx_event_posted.o \
    src/event/ngx_event_posted.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/event/ngx_event_accept.o \
    src/event/ngx_event_accept.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/event/ngx_event_connect.o \
    src/event/ngx_event_connect.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/event/ngx_event_pipe.o \
    src/event/ngx_event_pipe.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_time.o \
    src/os/unix/ngx_time.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_errno.o \
    src/os/unix/ngx_errno.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_alloc.o \
    src/os/unix/ngx_alloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_files.o \
    src/os/unix/ngx_files.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_socket.o \
    src/os/unix/ngx_socket.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_recv.o \
    src/os/unix/ngx_recv.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_readv_chain.o \
    src/os/unix/ngx_readv_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_udp_recv.o \
    src/os/unix/ngx_udp_recv.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_send.o \
    src/os/unix/ngx_send.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_writev_chain.o \
    src/os/unix/ngx_writev_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_channel.o \
    src/os/unix/ngx_channel.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_shmem.o \
    src/os/unix/ngx_shmem.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_process.o \
    src/os/unix/ngx_process.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_daemon.o \
    src/os/unix/ngx_daemon.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_setaffinity.o \
    src/os/unix/ngx_setaffinity.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_setproctitle.o \
    src/os/unix/ngx_setproctitle.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_posix_init.o \
    src/os/unix/ngx_posix_init.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_user.o \
    src/os/unix/ngx_user.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_process_cycle.o \
    src/os/unix/ngx_process_cycle.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_linux_init.o \
    src/os/unix/ngx_linux_init.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/event/modules/ngx_epoll_module.o \
    src/event/modules/ngx_epoll_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/os/unix/ngx_linux_sendfile_chain.o \
    src/os/unix/ngx_linux_sendfile_chain.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/src/core/ngx_regex.o \
    src/core/ngx_regex.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http.o \
    src/http/ngx_http.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_core_module.o \
    src/http/ngx_http_core_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_special_response.o \
    src/http/ngx_http_special_response.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_request.o \
    src/http/ngx_http_request.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_parse.o \
    src/http/ngx_http_parse.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_header_filter_module.o \
    src/http/ngx_http_header_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_write_filter_module.o \
    src/http/ngx_http_write_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_copy_filter_module.o \
    src/http/ngx_http_copy_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_log_module.o \
    src/http/modules/ngx_http_log_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_request_body.o \
    src/http/ngx_http_request_body.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_variables.o \
    src/http/ngx_http_variables.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_script.o \
    src/http/ngx_http_script.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_upstream.o \
    src/http/ngx_http_upstream.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_upstream_round_robin.o \
    src/http/ngx_http_upstream_round_robin.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_parse_time.o \
    src/http/ngx_http_parse_time.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_static_module.o \
    src/http/modules/ngx_http_static_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_index_module.o \
    src/http/modules/ngx_http_index_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_chunked_filter_module.o \
    src/http/modules/ngx_http_chunked_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_range_filter_module.o \
    src/http/modules/ngx_http_range_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_headers_filter_module.o \
    src/http/modules/ngx_http_headers_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_not_modified_filter_module.o \
    src/http/modules/ngx_http_not_modified_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_file_cache.o \
    src/http/ngx_http_file_cache.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_gzip_filter_module.o \
    src/http/modules/ngx_http_gzip_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/ngx_http_postpone_filter_module.o \
    src/http/ngx_http_postpone_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_ssi_filter_module.o \
    src/http/modules/ngx_http_ssi_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_charset_filter_module.o \
    src/http/modules/ngx_http_charset_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_userid_filter_module.o \
    src/http/modules/ngx_http_userid_filter_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_autoindex_module.o \
    src/http/modules/ngx_http_autoindex_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_auth_basic_module.o \
    src/http/modules/ngx_http_auth_basic_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_access_module.o \
    src/http/modules/ngx_http_access_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_limit_conn_module.o \
    src/http/modules/ngx_http_limit_conn_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_limit_req_module.o \
    src/http/modules/ngx_http_limit_req_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_geo_module.o \
    src/http/modules/ngx_http_geo_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_map_module.o \
    src/http/modules/ngx_http_map_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_split_clients_module.o \
    src/http/modules/ngx_http_split_clients_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_referer_module.o \
    src/http/modules/ngx_http_referer_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_rewrite_module.o \
    src/http/modules/ngx_http_rewrite_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_proxy_module.o \
    src/http/modules/ngx_http_proxy_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_fastcgi_module.o \
    src/http/modules/ngx_http_fastcgi_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_uwsgi_module.o \
    src/http/modules/ngx_http_uwsgi_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_scgi_module.o \
    src/http/modules/ngx_http_scgi_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_memcached_module.o \
    src/http/modules/ngx_http_memcached_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_empty_gif_module.o \
    src/http/modules/ngx_http_empty_gif_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_browser_module.o \
    src/http/modules/ngx_http_browser_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_upstream_hash_module.o \
    src/http/modules/ngx_http_upstream_hash_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
    src/http/modules/ngx_http_upstream_ip_hash_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
    src/http/modules/ngx_http_upstream_least_conn_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules \
    -o objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
    src/http/modules/ngx_http_upstream_keepalive_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules -I src/mail \
    -o objs/addon/nginx_upstream_check_module/ngx_http_upstream_check_module.o \
    //root/nginx/src/nginx_upstream_check_module/ngx_http_upstream_check_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules -I src/mail \
    -o objs/addon/src/ngx_http_upsync_module.o \
    /root/nginx/src/nginx-upsync-module/src/ngx_http_upsync_module.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules -I src/mail \
    -o objs/addon/src/ngx_http_json.o \
    /root/nginx/src/nginx-upsync-module/src/ngx_http_json.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g   -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs -I src/http -I src/http/modules -I src/mail \
    -o objs/addon/src/ngx_http_parser.o \
    /root/nginx/src/nginx-upsync-module/src/ngx_http_parser.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I //root/nginx/src/nginx_upstream_check_module -I objs \
    -o objs/ngx_modules.o \
    objs/ngx_modules.c
cc -o objs/nginx \
objs/src/core/nginx.o \
objs/src/core/ngx_log.o \
objs/src/core/ngx_palloc.o \
objs/src/core/ngx_array.o \
objs/src/core/ngx_list.o \
objs/src/core/ngx_hash.o \
objs/src/core/ngx_buf.o \
objs/src/core/ngx_queue.o \
objs/src/core/ngx_output_chain.o \
objs/src/core/ngx_string.o \
objs/src/core/ngx_parse.o \
objs/src/core/ngx_inet.o \
objs/src/core/ngx_file.o \
objs/src/core/ngx_crc32.o \
objs/src/core/ngx_murmurhash.o \
objs/src/core/ngx_md5.o \
objs/src/core/ngx_rbtree.o \
objs/src/core/ngx_radix_tree.o \
objs/src/core/ngx_slab.o \
objs/src/core/ngx_times.o \
objs/src/core/ngx_shmtx.o \
objs/src/core/ngx_connection.o \
objs/src/core/ngx_cycle.o \
objs/src/core/ngx_spinlock.o \
objs/src/core/ngx_cpuinfo.o \
objs/src/core/ngx_conf_file.o \
objs/src/core/ngx_resolver.o \
objs/src/core/ngx_open_file_cache.o \
objs/src/core/ngx_crypt.o \
objs/src/core/ngx_proxy_protocol.o \
objs/src/core/ngx_syslog.o \
objs/src/event/ngx_event.o \
objs/src/event/ngx_event_timer.o \
objs/src/event/ngx_event_posted.o \
objs/src/event/ngx_event_accept.o \
objs/src/event/ngx_event_connect.o \
objs/src/event/ngx_event_pipe.o \
objs/src/os/unix/ngx_time.o \
objs/src/os/unix/ngx_errno.o \
objs/src/os/unix/ngx_alloc.o \
objs/src/os/unix/ngx_files.o \
objs/src/os/unix/ngx_socket.o \
objs/src/os/unix/ngx_recv.o \
objs/src/os/unix/ngx_readv_chain.o \
objs/src/os/unix/ngx_udp_recv.o \
objs/src/os/unix/ngx_send.o \
objs/src/os/unix/ngx_writev_chain.o \
objs/src/os/unix/ngx_channel.o \
objs/src/os/unix/ngx_shmem.o \
objs/src/os/unix/ngx_process.o \
objs/src/os/unix/ngx_daemon.o \
objs/src/os/unix/ngx_setaffinity.o \
objs/src/os/unix/ngx_setproctitle.o \
objs/src/os/unix/ngx_posix_init.o \
objs/src/os/unix/ngx_user.o \
objs/src/os/unix/ngx_process_cycle.o \
objs/src/os/unix/ngx_linux_init.o \
objs/src/event/modules/ngx_epoll_module.o \
objs/src/os/unix/ngx_linux_sendfile_chain.o \
objs/src/core/ngx_regex.o \
objs/src/http/ngx_http.o \
objs/src/http/ngx_http_core_module.o \
objs/src/http/ngx_http_special_response.o \
objs/src/http/ngx_http_request.o \
objs/src/http/ngx_http_parse.o \
objs/src/http/ngx_http_header_filter_module.o \
objs/src/http/ngx_http_write_filter_module.o \
objs/src/http/ngx_http_copy_filter_module.o \
objs/src/http/modules/ngx_http_log_module.o \
objs/src/http/ngx_http_request_body.o \
objs/src/http/ngx_http_variables.o \
objs/src/http/ngx_http_script.o \
objs/src/http/ngx_http_upstream.o \
objs/src/http/ngx_http_upstream_round_robin.o \
objs/src/http/ngx_http_parse_time.o \
objs/src/http/modules/ngx_http_static_module.o \
objs/src/http/modules/ngx_http_index_module.o \
objs/src/http/modules/ngx_http_chunked_filter_module.o \
objs/src/http/modules/ngx_http_range_filter_module.o \
objs/src/http/modules/ngx_http_headers_filter_module.o \
objs/src/http/modules/ngx_http_not_modified_filter_module.o \
objs/src/http/ngx_http_file_cache.o \
objs/src/http/modules/ngx_http_gzip_filter_module.o \
objs/src/http/ngx_http_postpone_filter_module.o \
objs/src/http/modules/ngx_http_ssi_filter_module.o \
objs/src/http/modules/ngx_http_charset_filter_module.o \
objs/src/http/modules/ngx_http_userid_filter_module.o \
objs/src/http/modules/ngx_http_autoindex_module.o \
objs/src/http/modules/ngx_http_auth_basic_module.o \
objs/src/http/modules/ngx_http_access_module.o \
objs/src/http/modules/ngx_http_limit_conn_module.o \
objs/src/http/modules/ngx_http_limit_req_module.o \
objs/src/http/modules/ngx_http_geo_module.o \
objs/src/http/modules/ngx_http_map_module.o \
objs/src/http/modules/ngx_http_split_clients_module.o \
objs/src/http/modules/ngx_http_referer_module.o \
objs/src/http/modules/ngx_http_rewrite_module.o \
objs/src/http/modules/ngx_http_proxy_module.o \
objs/src/http/modules/ngx_http_fastcgi_module.o \
objs/src/http/modules/ngx_http_uwsgi_module.o \
objs/src/http/modules/ngx_http_scgi_module.o \
objs/src/http/modules/ngx_http_memcached_module.o \
objs/src/http/modules/ngx_http_empty_gif_module.o \
objs/src/http/modules/ngx_http_browser_module.o \
objs/src/http/modules/ngx_http_upstream_hash_module.o \
objs/src/http/modules/ngx_http_upstream_ip_hash_module.o \
objs/src/http/modules/ngx_http_upstream_least_conn_module.o \
objs/src/http/modules/ngx_http_upstream_keepalive_module.o \
objs/addon/nginx_upstream_check_module/ngx_http_upstream_check_module.o \
objs/addon/src/ngx_http_upsync_module.o \
objs/addon/src/ngx_http_json.o \
objs/addon/src/ngx_http_parser.o \
objs/ngx_modules.o \
-lpthread -lcrypt -lm -lpcre -lcrypto -lcrypto -lz
objs/addon/src/ngx_http_upsync_module.o: In function `ngx_http_upsync_add_peers':
/root/nginx/src/nginx-upsync-module/src/ngx_http_upsync_module.c:821: undefined reference to `ngx_http_upstream_check_add_dynamic_peer'
objs/addon/src/ngx_http_upsync_module.o: In function `ngx_http_upsync_del_peers':
/root/nginx/src/nginx-upsync-module/src/ngx_http_upsync_module.c:975: undefined reference to `ngx_http_upstream_check_delete_dynamic_peer'
collect2: error: ld returned 1 exit status
objs/Makefile:219: recipe for target 'objs/nginx' failed
make[1]: *** [objs/nginx] Error 1
make[1]: Leaving directory '/root/nginx/src/nginx-1.8.0'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2

同步consul服务器列表的时候用的是key

刚才测试了下
用docker regsitrator直接注册数据到consulkv 大概这个样子
image
报错了
image
找了半天bug
发现module做同步的时候是抓取的 key 的值

image

value哭晕在厕所

很想知道你们为什么用key而不是value?这样用起来方便吗

delayed upsync

Is it possible to add a flag to support delayed upsync?
If you have lots of upstream defined but only a few having traffic at a time, it doesn't make sense for every upstream to upsync against consul with numerous connections. We can do upsync only when there are traffic for the upstream. I think this is how jdomain is doing: https://github.com/wdaike/ngx_upstream_jdomain

Too many health checks

Using the https://github.com/xiaokai-wang/nginx_upstream_check_module , I noticed the same check is done by every nginx worker process. eg: if I have one upstream with two backend servers, each nginx worker process will check those two servers. If I have 32 cpu, and set check interval 1 second, I end up with 32 checks against one backend server every second, and total 64 checks per upstream.

https://github.com/yaoweibin/nginx_upstream_check_module works differently, and only sends one check, no matter how many worker process.

how to add/tuning backup of an upstream

curl -XPUT -d value='{"weight":1, "max_fails":2, "fail_timeout":8, "backup":1}' http://192.168.2.111:4001/v2/keys/upstreams/api_module/192.168.2.12:80
curl -XPUT -d value='{"weight":1, "max_fails":2, "fail_timeout":8, "backup":0}' http://192.168.2.111:4001/v2/keys/upstreams/api_module/192.168.2.12:80

not working

Starting a server with node backup=1 means crash

Hi,
we've found also one crash during startup - when any upstream is set as backup=1 it will make the upsync module crash.

The reason is simple:
in ngx_http_upsync_add_peers, there is
if (server->backup) { continue; }
which means that when ngx_http_upsync_del_peers runs, it will crash on
if (ngx_memn2cmp((u_char *) tmp_peers->peer[i].sockaddr, (u_char *) server->addrs->sockaddr, len, len)
as the parameters are 0/NULL.

The easiest fix is to just ignore the backup parameter (and comment out the continue;). I have tried reading the official source for nginx upstream RR balancing, but I have no idea how backup nodes are supposed to behave so I am not sure of the proper fix.

Sorry, I speak only English.

nginx-1.9.15编译报错:‘ngx_http_upstream_rr_peer_t’ has no member named ‘check_index’

系统环境:
CentOS-6.3
gcc-4.4.6
nginx-1.9.15

modules/nginx-upsync-module/src/ngx_http_upsync_module.c: In function ‘ngx_http_upsync_add_peers’: modules/nginx-upsync-module/src/ngx_http_upsync_module.c:823: error: ‘ngx_http_upstream_rr_peer_t’ has no member named ‘check_index’ modules/nginx-upsync-module/src/ngx_http_upsync_module.c: In function ‘ngx_http_upsync_del_peers’: modules/nginx-upsync-module/src/ngx_http_upsync_module.c:1001: error: ‘ngx_http_upstream_rr_peer_t’ has no member named ‘check_index’ modules/nginx-upsync-module/src/ngx_http_upsync_module.c:1001: error: ‘ngx_http_upstream_rr_peer_t’ has no member named ‘check_index’ modules/nginx-upsync-module/src/ngx_http_upsync_module.c: In function ‘ngx_http_upsync_init_peers’: modules/nginx-upsync-module/src/ngx_http_upsync_module.c:2186: error: ‘ngx_http_upstream_rr_peer_t’ has no member named ‘check_index’ modules/nginx-upsync-module/src/ngx_http_upsync_module.c:2186: error: ‘ngx_http_upstream_rr_peer_t’ has no member named ‘check_index’

请问upsync支持到nginx哪个最新小版本号?

worker thread dies if the keys returned in recurse call do not contain '/'

In our setup, we used upsync path with '_' as separator instead of '/' as we use it with proxy_pass and '/' has a special meaning in proxy_pass.

For example, our upsync path looks like this, 127.0.0.1:8500/v1/kv/upstreams_pool and consul paths look like this

v1/kv/upstreams_pool/server1:port
v1/kv/upstreams_pool/server2:port
v1/kv/upstreams_pool/server3:port

This works fine. However, if we add a new path like v1/kv/upstreams_pool w/o server entry and '/' to consul, then worker threads keeps dying and re-spawning.

We have changed our consul path to the recommended way as shown in docs with '/' now and use '_' only in proxy pass URI.

Connection to ETCD starts failing after some time

Hey,
we've been testing the module in dev for some time now, but we've run into an odd issue - after some time the nginx stops connecting to the ETCD:

2016/04/19 11:05:05 [error] 20129#0: recv() failed (104: Connection reset by peer)
2016/04/19 11:05:05 [error] 20129#0: upsync_recv: recv error with upsync_server: 127.0.0.1:4379

It happens about 2 - 3 hours since last etcd change.

I have not managed to track down as to why this happens - the ETCD log file does not give any hints. I can get data off the etcd just fine, just as after sending HUP to the nginx resets it and it works again fine.

Sadly I am going away until the end of the month so I cannot help to track down the issue right now.
I thought that the etcd connection should automatically reconnect on failure or closed connection... or not?

the compatible problem of nginx-upsync-module with nginx_upstream_check_module

nginx-upsync-module supports health check of dynamicly adding backend servers with nginx_upstream_check_module, needs dynamicly operating interface of nginx_upstream_check_module.

but newly ngx_http_upstream_check_module.c file not update to nginx_upstream_check_module.git, so you need to use 'https://github.com/alibaba/tengine/blob/master/src/http/ngx_http_upstream_check_module.c' replace 'https://github.com/yaoweibin/nginx_upstream_check_module/blob/master/ngx_http_upstream_check_module.c'.

thanks

链接共享

目前upsync是定义在upstream里,这是否意味着如果我有几万个upstream,nginx在同一时刻会有几万个链接到consul?是否有什么方法可以让所有的upstream共享一个或几个链接到consul?这会节省很多资源。

如何监听Docker容器的启停自动更新Consul KV?

nginx-upsync模块会查询Consul KV中的列表,Consul KV中的列表如何根据Docker启停自动更新的呢?weibocom单独开发了模块还是使用第三方工具(比如registrator)?
另外有没有监控Docker的资源状况自动调整server的权重呢?

etcd rasing memory usage by time

using this module, only 10 keys of upstream in etcd.
Etcd cost 16MB memory firstly, then after 6 hours, raise to 523MB。Finally oom.
How to solve the problem.

data from: ps -ylC etcd (RSS filed)
etcd version: both etcd version 2.0.5 and etcd Version: 2.3.1

nginx 1.9.x support

There are many nginx-upsync-module changes in master since the nginx-1.9.x branch was created early Feb. Is it possible to wrap those nginx-1.9.x changes with ifdef's so that we can maintain one code base?

reload takes long time

upsync provides dynamically modifying backend servers without reloading nginx, but when I need to add more virtual hosts and more upstream blocks, nginx reload is still needed.

Whenever we reload nginx (send SIGHUP), we see old nginx process in the state of nginx: worker process is shutting down and then go away.

Without upsync module, those old nginx processes disappears almost immediately when there is no traffic, but with upsync module, I see those old nginx processes in "shutting down" state for a long time. In one of my tests, I reloaded nginx three times by sending SIGHUP to the master nginx process 3 times which generated some of those "shutting down" nginx processes. It took more than 5 minutes and finally they went away. The problem is each of those "shutting down" process uses same amount of system memory, and server ran out of memory quickly.

consul service discovery

upsync currently uses kv from consul. Is it possible to enhance it to use consul's service discovery? A service can map to one nginx upstream. When server registers/unregisters a service, it can be added/removed from the nginx upstream. Consul supports service health check, so if a server fails health check by consul, it will be removed from the service, and nginx won't even need to do its own health checks.

建议:使用ngx_conf_parse来解析所有配置

你好!
我阅读了源码,发现你们是自己在解析upstream里的每一项配置的,例如peer里的weight等等....最近还加了lb配置....我觉得其实没有必要这样做,使用nginx原有的配置解析机制来解析就一劳永逸了,否则每一项配置都自己解析、设置各个字段太蛋疼了,以后还要跟着nginx的步伐支持新配置。

这是可以做到的,这部分功能我已经实现过了。
参考一下upstream模块的配置解析函数即可。

Get servers from multiple paths

Can upsync be configured to read server list from multiple paths? e.g.: I have some servers defined in consul 127.0.0.1:8500/v1/kv/upstreams/test1 and some others in 127.0.0.1:8500/v1/kv/upstreams/test2 , I need to create an upstream with servers from both test1 and test2. Is this do-able?
Can I create 127.0.0.1:8500/v1/kv/upstreams/test/test1 and 127.0.0.1:8500/v1/kv/upstreams/test/test2, then configure nginx upsync to 127.0.0.1:8500/v1/kv/upstreams/test ?

DNS interface

In addition to http, consul also supports DNS query. Is it possible for upsync to add DNS support? The consul DNS SRV record seems to be a good fit for nginx upstream. It provides the IP/port/weight of the servers.

如果直接支持k8s的etcd的service的endpoint的格式会怎么样

nginx直接获取endpoints,生成upstreams
etcdctl get /registry/services/endpoints/default/open-falcon|python -m json.tool
{
"apiVersion": "v1",
"kind": "Endpoints",
"metadata": {
"creationTimestamp": "2016-03-11T13:48:08Z",
"labels": {
"open-falcon/cluster-service": "true",
"open-falcon/name": "open-falcon"
},
"name": "open-falcon",
"namespace": "default",
"resourceVersion": "340988",
"selfLink": "/api/v1/namespaces/default/endpoints/open-falcon",
"uid": "e32bfea2-e78f-11e5-9b7d-ecf4bbdfa200"
},
"subsets": [
{
"addresses": [
{
"ip": "10.10.10.10",
"targetRef": {
"kind": "Pod",
"name": "open-falcon-wzute",
"namespace": "default",
"resourceVersion": "341001",
"uid": "ca602bf5-e78f-11e5-9b7d-ecf4bbdfa200"
}
}
],
"ports": [
{
"name": "open-falcon",
"port": 6030,
"protocol": "TCP"
}
]
}
]
}

不支持nginx -s reload ?

当执行 nginx -s reload 之后.
会发现 旧的nginx worker process 进程已经标记为 shutting down。
新的worker process 也已经成功启动。但是旧的shutting down进行一直存在,没有退出。

14 root 0:00 nginx: master process /usr/local/nginx/sbin/nginx
15 root 0:00 nginx: worker process is shutting down
16 root 0:00 nginx: worker process is shutting down
17 root 0:00 nginx: worker process is shutting down
18 root 0:00 nginx: worker process is shutting down
32 root 0:00 nginx: worker process is shutting down
33 root 0:00 nginx: worker process is shutting down
34 root 0:00 nginx: worker process is shutting down
35 root 0:00 nginx: worker process is shutting down
57 root 0:00 nginx: worker process is shutting down
58 root 0:00 nginx: worker process is shutting down
59 root 0:00 nginx: worker process is shutting down
60 root 0:00 nginx: worker process is shutting down
114 root 0:00 nginx: worker process is shutting down
115 root 0:00 nginx: worker process is shutting down
116 root 0:00 nginx: worker process is shutting down
117 root 0:00 nginx: worker process is shutting down
123 root 0:00 nginx: worker process is shutting down
124 root 0:00 nginx: worker process is shutting down
125 root 0:00 nginx: worker process is shutting down
126 root 0:00 nginx: worker process is shutting down
190 root 0:00 nginx: worker process is shutting down
191 root 0:00 nginx: worker process is shutting down
192 root 0:00 nginx: worker process is shutting down
193 root 0:00 nginx: worker process is shutting down
197 root 0:00 nginx: worker process
198 root 0:00 nginx: worker process
199 root 0:00 nginx: worker process
200 root 0:00 nginx: worker process

Sudden odd behaviour with ETCD

Hi,
as we were ready to try it for the first time in prod after few weeks in dev, where it worked fine, we suddenly ran into an issue of the nginx not updating changes and spewing out "connection reset by peer" errors.
After few hours of digging and tcpdumping I noticed that there is extra space in front of Accept / on lines 2562 and 2567, which makes it invalid and silently fail (ETCD reports 400 Bad Request). That's been fixed and I will PR it later. ( CallMeFoxie@5c65a3e ) - I have no idea how this could have ever worked until now?!

But that's not everything. After fixing this we finally get requests on ETCD... but right after receiving a packet with the header for wait the connection gets [R]eset. And at this point I have no idea what is going on anymore :( Do you happen do have any ideas? The initial GET /v2/.../upstream? is fine, but after that the GET /v2/.../upstream?wait=true&recursive=true starts resetting the connection. I will be digging further to see if I can find it, but the code is long :/ I can telnet/curl just fine without any resets...

一些问题

@xiaokai-wang
我用marathon 动态更新容器 容器端口随机
然后通过docker registrator注册到consul里边
nginx配置文件里边写的是:
1.upsync 127.0.0.1:8500/v1/kv/haserver/haserver
image
我在添加和删除consul里边的ip的时候
/usr/local/nginx/conf/servers/servers_test.conf
里的列表确实能够正常动态更新
但我一旦将/kv/haserver/haserver整个删除
servers_test.conf并不会更新(变成空)
2. 我将轮询间隔设置了50ms
然后用benchmark去测试nginx
刚开始测试挺正常的
但随着我更新consul
发现经常有upstream失败的情况
ab -n 10 -c 10 http://192.168.1.55/
image

image

这种情况经常出现 而且都是整数型的失败
image
image

image

同一个update_stream name下添加多个服务报错

添加3个服务

curl -X PUT -d "{\"weight\":1, \"max_fails\":2, \"fail_timeout\":10}" http://127.0.0.1:8500/v1/kv/upstreams/test/172.18.18.10:1234
curl -X PUT -d "{\"weight\":1, \"max_fails\":2, \"fail_timeout\":10}" http://127.0.0.1:8500/v1/kv/upstreams/test/172.18.18.10:1235
curl -X PUT -d "{\"weight\":1, \"max_fails\":2, \"fail_timeout\":10}" http://127.0.0.1:8500/v1/kv/upstreams/test/172.18.18.10:1236

consul 日志:

...
2016/03/22 05:34:42 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (149.023µs) from=127.0.0.1:38853
    2016/03/22 05:34:43 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (146.759µs) from=127.0.0.1:38854
    2016/03/22 05:34:45 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (149.853µs) from=127.0.0.1:38855
    2016/03/22 05:34:46 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (111.46µs) from=127.0.0.1:38856
    2016/03/22 05:34:48 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (142.696µs) from=127.0.0.1:38857
    2016/03/22 05:34:48 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (112.089µs) from=127.0.0.1:38858
    2016/03/22 05:34:49 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (114.29µs) from=127.0.0.1:38859
    2016/03/22 05:34:50 [DEBUG] http: Request GET /v1/kv/upstreams/test?recurse&index=169 (148.245µs) from=127.0.0.1:38860
...

nginx 日志

...
2016/03/22 05:35:09 [error] 18879#0: recv() failed (104: Connection reset by peer)
2016/03/22 05:35:09 [error] 18879#0: upsync_recv: recv error with upsync_server: 127.0.0.1:8500
2016/03/22 05:35:10 [error] 18879#0: recv() failed (104: Connection reset by peer)
2016/03/22 05:35:10 [error] 18879#0: upsync_recv: recv error with upsync_server: 127.0.0.1:8500
2016/03/22 05:35:11 [error] 18879#0: recv() failed (104: Connection reset by peer)
2016/03/22 05:35:11 [error] 18879#0: upsync_recv: recv error with upsync_server: 127.0.0.1:8500
2016/03/22 05:35:13 [error] 18879#0: recv() failed (104: Connection reset by peer)
2016/03/22 05:35:13 [error] 18879#0: upsync_recv: recv error with upsync_server: 127.0.0.1:8500
2016/03/22 05:35:13 [error] 18879#0: recv() failed (104: Connection reset by peer)
2016/03/22 05:35:13 [error] 18879#0: upsync_recv: recv error with upsync_server: 127.0.0.1:8500
2016/03/22 05:35:14 [error] 18879#0: recv() failed (104: Connection reset by peer)
...

页面访问http://172.18.21.2:8080/upstream_show?test:

Upstream name: test; Backend server count: 2
        server 172.18.18.10:1234 weight=1 max_fails=2 fail_timeout=10s;
        server 172.18.18.10:1235 weight=1 max_fails=2 fail_timeout=10s;

.../servers/servers_test.conf:

server 172.18.18.10:1234 weight=1 max_fails=2 fail_timeout=10s;
server 172.18.18.10:1235 weight=1 max_fails=2 fail_timeout=10s;

始终有一个写入不了文件

等待大约3分钟左右,数据都正常了。也不报错了

这个是怎么回事呀,是不是我数据添加方式不对?

upsync不同步etcd配置

环境:nginx-1.10.0 + upsync

问题:
nginx重启后的开始一段时间,upsync可以及时同步etcd中的配置变更,但后来再也不同步配置了。感觉像upsync和etcd之间的连接出现了问题。

Upstream name: test_upstream; Backend server count: 3
server 10.112.76.147:8060 weight=58 max_fails=2 fail_timeout=10s;
server 10.112.64.13:8060 weight=29 max_fails=2 fail_timeout=10s;
server 10.112.76.89:8060 weight=64 max_fails=2 fail_timeout=10s;

etcd中的一条weight信息,可以看到和上面的weight并没有同步:

key: /test_upstream/10.112.76.147:8060
value: {"weight":61,"max_fails":2,"fail_timeout":10,"host":"10.112.76.147","idc":"c3","port":8060,"instance_id":"fd09340e14c87692deaedad100248abc7bee20b55c304edc3f32890522852bf4","timeout":10,"uris":["test.example.com"]}

keepalive的值会自动变化

模板文件设置如下
upstream test {
server 127.0.0.1:11111;

upsync 192.168.80.142:8500/v1/kv/bnspear/upstream/test/vitality  upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
upsync_conf_path /tmp/test.conf;

keepalive 512;
check interval=3000 rise=2 fall=3 timeout=2000 type=tcp;

}

同步后/tmp/test.conf中keepalive的数值会自动改变,并且这个数值会随着反向代理的node数量相等
upstream test {
keepalive 4;

upsync 192.168.80.142:8500/v1/kv/bnspear/upstream/zeus.eus/vitality upsync_interval=500ms upsync_timeout=360000ms upsync_type=consul;
upsync_conf_path /tmp/test.conf;

server 192.168.11.2:15200 weight=1 max_fails=3 fail_timeout=30s;
server 192.168.11.3:15200 weight=1 max_fails=3 fail_timeout=30s;
server 192.168.11.4:15200 weight=1 max_fails=3 fail_timeout=30s;
server 192.168.11.5:15200 weight=1 max_fails=3 fail_timeout=30s;

check interval=3000 rise=2 fall=3 timeout=2000 type=tcp default_down=true;
check_keepalive_requests 1;
check_http_send "";
check_http_expect_alive http_2xx http_3xx;

}

不支持域名方式添加upstream?

我做了一个这样的测试:将域名testnginx.com 指向172.18.21.2(我的后端测试服务器)。上面开启了1234、1235、1236、1237、1238等端口的服务,通过如下的方式将服务添加到consul中。

 curl -X PUT -d "{\"weight\":2, \"max_fails\":2, \"fail_timeout\":10}" http://$etcd_ip:$port/v2/keys/$dir1/$upstream_name/$domain:$backend_port

如:

 curl -X PUT -d "{\"weight\":2, \"max_fails\":2, \"fail_timeout\":10}" http://172.18.18.10:8500/v2/keys/upstreams/test/testnginx.com:1234

此时,这条记录不会添加成功,但如果通过ip的方式是可以的

配多个upsync upstream,upstream_check_module的status页面所有upstream server都是一样的

upsync 0.2.2/master
ngx_http_upstream_check_module Tengine/2.2.0 (nginx/1.8.0)自带

多个upsync upstream, nginx start的时候upstream_check用的都是最后一个upstream的server,reload也会出现不一致的情况
你们应该也有配多个upstream吧,是不是我哪里没用对?

配置如下:
test.conf

upstream testxyz {
        server 127.0.0.1:11111;
        upsync 192.168.65.53:8500/v1/kv/bnspear/upstream/zeus.eus/testxyz upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
        upsync_dump_path /tmp/testxyz.conf;

        keepalive 512;
        check interval=3000 rise=2 fall=5 timeout=1000 type=http;
        check_http_send "HEAD / HTTP/1.0\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx;
}

upstream good {
        server 127.0.0.1:11111;
        upsync 192.168.65.53:8500/v1/kv/bnspear/upstream/zeus.eus/good upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
        upsync_dump_path /tmp/good.conf;

        keepalive 512;
        check interval=3000 rise=2 fall=5 timeout=1000 type=http;
        check_http_send "HEAD / HTTP/1.0\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx;
}

upstream test2 {
    server 127.0.0.1:11111;
    server 10.97.197.123:9061 down;

    check interval=3000 rise=2 fall=5 timeout=1000 type=http;
        check_http_send "HEAD / HTTP/1.0\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx;
}


server {
        listen 8080;

    location = / {
        proxy_pass http://test;
    }
    location = /t {
        proxy_pass http://good;
    }

    location = /upstream_show {
        upstream_show;
    }

    location /status {
            check_status;
            access_log   off;
        }
}

check.conf

upstream cluster1 {
    # simple round-robin
    server 192.168.0.1:80;
    server 192.168.0.2:80;

    check interval=3000 rise=2 fall=5 timeout=1000 type=http;
    check_http_send "HEAD / HTTP/1.0\r\n\r\n";
    check_http_expect_alive http_2xx http_3xx;
}

upstream cluster2 {
    # simple round-robin
    server 192.168.0.3:80;
    server 192.168.0.4:80;

    check interval=3000 rise=2 fall=5 timeout=1000 type=http;
    check_keepalive_requests 100;
    check_http_send "HEAD / HTTP/1.1\r\nConnection: keep-alive\r\n\r\n";
    check_http_expect_alive http_2xx http_3xx;
}
upstream test {
    server 127.0.0.1:11111;
    upsync 192.168.65.53:8500/v1/kv/bnspear/upstream/bbcyong/test upsync_timeout=6m upsync_interval=500ms upsync_type=consul strong_dependency=off;
    upsync_dump_path /tmp/test.conf;

    keepalive 512;
    check interval=3000 rise=2 fall=5 timeout=1000 type=http;
        check_http_send "HEAD / HTTP/1.0\r\n\r\n";
        check_http_expect_alive http_2xx http_3xx;
}

server {
    listen 8008;
    server_name test.tt;
}

upsync dump

#test
server 192.168.42.53:8080 weight=1 max_fails=2 fail_timeout=10s;
server 192.168.42.54:8080 weight=1 max_fails=2 fail_timeout=10s;
server 192.168.42.55:8080 weight=1 max_fails=2 fail_timeout=10s;

#testxyz
server 192.168.112.208:15200 weight=1 max_fails=3 fail_timeout=30s;
server 192.168.112.235:15200 weight=1 max_fails=3 fail_timeout=30s;
server 192.168.112.91:15200 weight=1 max_fails=3 fail_timeout=30s;
server 192.168.68.110:15200 weight=1 max_fails=3 fail_timeout=30s;

#good
server 192.168.65.53:8080 weight=1 max_fails=30 fail_timeout=30s;
server 192.168.65.53:8081 weight=1 max_fails=2 fail_timeout=10s;
server 192.168.65.89:8080 weight=1 max_fails=2 fail_timeout=10s;
server 192.168.65.99:8080 weight=1 max_fails=2 fail_timeout=10s;

Tengine status, start
image

reload
image

nginx worker signal 11 问题

按照如下配置时,配置问题test通过,运行起来的时候,worker不停的退出,信号11,是经典的segmentation fault,应该是内存引用的问题,确定consul地址是正确的:

upstream consul {
    # fake server otherwise ngx_http_upstream will report error when startup
    server 127.0.0.1:11111;

    # all backend server will pull from consul when startup and will delete fake server

    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 /data/server/nginx_consul/conf/upstreams/upstream_consul.conf;
}

server {
    listen 18080;

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

    location = /upstream_show {
        upstream_show;
    }
}

woker不停退出的日志如下:

2016/01/06 14:45:45 [alert] 22928#0: worker process 29593 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29594 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29595 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29596 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29597 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29599 exited on signal 11
2016/01/06 14:45:45 [alert] 22928#0: worker process 29600 exited on signal 11

每秒几十条,去掉upsync和upsync_dump_path配置项后 worker是可以稳定存活

allow show all upstreams

Is it possible to let upstream_show to list all upstreams?
Currently if I don't specify one, I will get

Please input specific upstream name

Race condition with ETCD

Hi,
We've also noticed yet another problem. With issue #59 fixed we've actually introduced another problem - a race condition. If 2 (or more) things change in ETCD right after each other, then only the first one might get registered.
-> ETCD is at index 100.
-> we introduce a change, ETCD is at 101
-> wait=true triggers for reload, starts downloading and parsing at ETCD index 101
-> we introduce another change, ETCD is at 102
-> upsync finishes reloading, thinking we are waiting for 102, but we have already had 102 change

The (probably correct?) fix would be to revert the change and keep waitIndex BUT make sure that the upsync module can handle 400 Bad Request reply with this content:
{"errorCode":401,"message":"The event in requested index is outdated and cleared","cause":"the requested history has been cleared [216457/211]","index":217456}
which it can not as of right now and keeps triggering only receive errors repeatedly.

I have no idea if consul drops old indexes as well. If yes then the original issue exists there as well.

tengine master版本编译不同通过

大拿,此模块在tengine master下编译不通过,报错如下
-L/opt/websuite/tengine/lib -Wl,-E -lpthread -ldl -lcrypt -L/opt/websuite/tengine/lib -lluajit-5.1 -lm -ldl -lm ../pcre-8.36/.libs/libpcre.a -lssl -lcrypto -ldl -lz -lgd -ljemalloc
objs/addon/src/ngx_http_upsync_module.o: In function ngx_http_upsync_least_conn_init': /root/source/tengine/nginx-upsync-module/src/ngx_http_upsync_module.h:120: undefined reference tongx_http_upstream_least_conn_module'
objs/addon/src/ngx_http_upsync_module.o: In function ngx_http_upsync_del_peer_least_conn': /root/source/tengine/nginx-upsync-module/src/ngx_http_upsync_module.h:157: undefined reference tongx_http_upstream_least_conn_module'
collect2: ld 返回 1
make[1]: *** [objs/nginx] 错误 1
make[1]: Leaving directory `/root/source/tengine/src/tengine'
make: *** [build] 错误 2

请大拿协助呀

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.