0

All,

We have an infrastructure where we have 1 consul server, 2 ngnix web servers and 2 application servers. The app servers connects to consul to register the services. The Ngnix server will connect to consul and updates the ngix.conf file using the nginx.ctmpl (consultemplate config) file to have the latest information on the services via consul.

The problem I see is that the nginx.conf is not getting updated on the 2 nginx servers. The following are the agents/services running on each server: Consul server:

  • consul
  • consultemplate

Ngix servers:

  • nginx
  • consultemplate

Application Servers:

  • consul

Couple of questions here:

  1. Which agent/process/service on Nginx will use the nginx.cmptl file to update the nginx.conf with the latest status?
  2. What can be a problem on my nginx servers?
user3379502
  • 223
  • 4
  • 22

2 Answers2

0

Nginx does not utilize that template directly. consul-template should be configured to use nginx.cmptl to template the config, and reload nginx.

See Load Balancing with NGINX and Consul Template for an example of this configuration.

Can you verify that the consul-template service is running, and perhaps provide any error logs it might be generating?

Blake Covarrubias
  • 2,138
  • 2
  • 6
  • 14
0

The problem is solved. I renamed the data directory for the Consul in Nginx servers and ran the chef-client. I recreated the data directory and the Consul server was able to identify the two Nginx servers and the 2 application servers. Everything is back in the working condition.

user3379502
  • 223
  • 4
  • 22