xiaokai-wang / nginx-stream-upsync-module

For stream protocol. syncing upstreams from etcd or consul and so on, dynamically updating backend servers attribute, not need to reload nginx for tcp protocol, stream configure.
175 stars 48 forks source link

无法获取etcd的数据信息 #38

Open xiaoxiangs opened 5 years ago

xiaoxiangs commented 5 years ago

版本:1.12.2(也尝试过1.14.2) 编译方式: configure --add-module=./nginx-stream-upsync-module --with-stream 配置: stream { upstream test { server 127.0.0.1:8080 down; upsync 10.120.174.5:2379/v2/keys/test/nginx/upstream2 upsync_timeout=6m upsync_interval=500ms upsync_type=etcd strong_dependency=off; upsync_dump_path /opt/nginx_upstream/flow.test.yidian-inc.com_stream2.conf;

    include /opt/nginx_upstream/flow.test.yidian-inc.com_stream2.conf;
}

server {
    listen 12345;

    proxy_connect_timeout 1s;
    proxy_timeout 3s;
    proxy_pass test;
}

}

etcd数据测试:

curl 10.120.174.5:2379/v2/keys/test/nginx/upstream2

{"action":"get","node":{"key":"/test/nginx/upstream2","dir":true,"nodes":[{"key":"/test/nginx/upstream2/10.126.172.17:8080","value":"{\"weight\":1, \"max_fails\":2, \"fail_timeout\":10, \"down\":0}","modifiedIndex":1110957,"createdIndex":1110957}],"modifiedIndex":1110862,"createdIndex":1110862}}

麻烦帮忙看下哪里有问题?

xiaokai-wang commented 4 years ago

没看出什么问题了,你可以debug 模式看看日志. server 127.0.0.1:8080 down; 应该放到flow.test.yidian-inc.com_stream2.conf 文件里