Consul模板使用Nginx,Consul-template和Docker获取存储关键字前缀错误

新的Nginx和领事模板,但我认为我有一切工作,除了我收到很多噪音(100或100左右的错误消息,每15-30秒)在日志中的错误forms。 看起来像它是不能连接/获取数据的consul-template错误…但它确实获取数据并正确地构build模板。 所以,不知道是什么问题。

我该如何解决这些错误? 或者,如果他们是预料之中,我怎么不能login到stdout / stderr这是混乱我的nginx日志logging。

谢谢,丹

错误(为各种应用程序重复获取这些消息):

2017/01/17 20:07:35 [ERR] (view) "storeKeyPrefix(services/prod/SOMEAPP/SOMEKEY)" store key prefix: error fetching: Get http://consul.example.com:8500/v1/kv/services/prod/SOMEAPP/SOMEKEY/?index=13120537&recurse=&stale=&wait=60000ms: EOF 2017/01/17 20:07:35 [ERR] (runner) watcher reported error: store key prefix: error fetching: Get http://consul.example.com:8500/v1/kv/services/prod/SOMEAPP/SOMEKEY/?index=13120537&recurse=&stale=&wait=60000ms: EOF 

Nginx的dockerfile

 FROM nginx:1.11.8 RUN rm /etc/nginx/conf.d/default.conf COPY html /usr/share/nginx/html COPY conf /etc/nginx RUN DEBIAN_FRONTEND=noninteractive \ apt-get update -qq && \ apt-get -y install curl runit unzip && \ rm -rf /var/lib/apt/lists/* ENV CT_URL https://releases.hashicorp.com/consul-template/0.15.0/consul-template_0.15.0_linux_amd64.zip RUN curl -o consul-template.zip $CT_URL && \ unzip consul-template.zip && \ chmod a+x consul-template && \ mv consul-template /usr/bin/consul-template ADD services/nginx.service /etc/service/nginx/run RUN chmod a+x /etc/service/nginx/run ADD services/consul-template.service /etc/service/consul-template/run RUN chmod a+x /etc/service/consul-template/run ADD templates/nginx-http-upstream.conf /etc/consul-templates/nginx-http.conf ADD templates/nginx-tcp-upstream.conf /etc/consul-templates/nginx-tcp.conf RUN touch /etc/nginx/conf.d/http.conf RUN touch /etc/nginx/conf.d/tcp.conf EXPOSE 80 EXPOSE 443 CMD ["/usr/bin/runsvdir", "/etc/service"] 

服务/ nginx.service

 #!/bin/sh /usr/sbin/nginx -c /etc/nginx/nginx.conf -t && \ exec /usr/sbin/nginx -c /etc/nginx/nginx.conf -g "daemon off;" 

服务/领事template.service

 #!/bin/sh exec consul-template \ -consul=$CONSUL_HOST:$CONSUL_PORT \ -log-level=warn \ -template "/etc/consul-templates/nginx-http.conf:/etc/nginx/conf.d/http.conf:sv hup nginx"\ -template "/etc/consul-templates/nginx-tcp.conf:/etc/nginx/conf.d/tcp.conf:sv hup nginx"