Consul: how to Definition multiple nodes all register the same service?

Created on 18 May 2017  路  1Comment  路  Source: hashicorp/consul

how to Definition multiple nodes all register the same service? for example

service : web

web node1: 172.10.16.1 node2:172.10.16.2 node3:172:10.16.3

web.json how to Definition?

Most helpful comment

Hi @dzhyw you register services on the agents where the service is running, so for something like that you'd have the same web.json formatted as in (https://www.consul.io/docs/agent/services.html) deployed along with the web server, or you could have your application use an API (https://www.consul.io/api/agent/service.html#register-service) to register itself. If you are using the json file, you could package it with your application, for example. Hope that helps!

>All comments

Hi @dzhyw you register services on the agents where the service is running, so for something like that you'd have the same web.json formatted as in (https://www.consul.io/docs/agent/services.html) deployed along with the web server, or you could have your application use an API (https://www.consul.io/api/agent/service.html#register-service) to register itself. If you are using the json file, you could package it with your application, for example. Hope that helps!

Was this page helpful?
0 / 5 - 0 ratings