Query K/V of another consul datacenter

234 views
Skip to first unread message

nss pradeep

unread,
Sep 18, 2017, 12:45:27 PM9/18/17
to Consul
Hi,

I have two consul clusters each with 3 consul servers one in each datacenter (dc1 and dc2). I have joined them as WAN members so that i can query the key/value from each other.

I have created a key /cluster/clusterName/test in consul of dc2. Now from dc1, i am trying the following:

curl http://localhost:8500/v1/kv/cluster/clusterName/test/?dc=dc2 --> This returns me the value properly

curl http://localhost:8500/v1/kv/cluster/?dc=dc2&recurse=true --> Does not return a value as it looks like it is ignoring dc query parameter

I also tried using keys=true&separator='/' as query parameters along with dc but still same issue.

Is that we can only query specific key located in another datacenter of consul and not the keys ?

Thanks,
Pradeep NSS

Brian Lalor

unread,
Sep 19, 2017, 12:06:30 PM9/19/17
to Consul
If you’re running those curl commands literally, the 2nd one has an ampersand that would be interpreted by the shell; put the URL in quotes.

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/d3cf431c-8525-4692-aae5-688f01821c9d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

— 
Brian Lalor

signature.asc

nss pradeep

unread,
Sep 25, 2017, 12:09:39 PM9/25/17
to Consul
Hi Brian,

Yes, It was that mistake. Thank you.
Reply all
Reply to author
Forward
0 new messages