I’m trying to configure a job that points to IPs across datacenters.
Datacenters a configured:
job "seaweedfs" {
datacenters = ["dc1", "dc2"]
}
Here is the code i’m trying to setup within my template:
{{ range service "seaweedfs-server" }}{{ .Address }}:{{ .Port }},{{ end }}
The problem is this range only gets the IP address for one datacenter only (example, dc1 and dc2 jobs will give the “service” IPs local to it’s datacenter) and not across datacenters. How do i remove this limitation?
Hi @zaihan since this is consul-template under the hood, take a look at the docs for the service function and how to get results from more than one datacenter.