Unable to get the server details from remote consul server

My consul-template is unable to get the server details from remote consul server. I have set up consul-template and ha-proxy on the load balancer server which queries the consul server for the service stats.

My consul-template

frontend http-in
 bind *:80
 default_backend www

backend www{{range service "www"}}
 server {{.ID}} {{.Address}}:{{.Port}}{{end}}

This renders to the below haproxy.cfg after the command consul-template -consul-addr 122.134.124.11:8500 -template=/tmp/haproxy2.conf.ctmpl:/etc/haproxy/haproxy.cfg -log-level=debug

frontend http-in
 bind *:80
 default_backend www

backend www

This the error message on the console

2017/10/09 03:42:10.995574 [DEBUG] (runner) rendering "/tmp/haproxy2.conf.ctmpl" => "/etc/haproxy/haproxy.cfg"
2017/10/09 03:42:10.995631 [DEBUG] (runner) diffing and updating dependencies
2017/10/09 03:42:10.995641 [DEBUG] (runner) health.service(www|passing) is still needed
2017/10/09 03:42:10.995650 [DEBUG] (runner) watching 1 dependencies
2017/10/09 03:42:10.995657 [DEBUG] (runner) all templates rendered

The consul server and the service is running fine. However, my consul-template is unable to render the correct haproxy.cfg

0 Comment

NO COMMENTS

LEAVE A REPLY

Captcha image