0

I would like to connect Vitess (for example, vtcld) to Consul (as Topo server) but I need to pass dc parameter. I thought it should be done in consul_auth_static_file but I guess it is only being used for authentication purpose.

So, the questions is: How can I do this? How to pass dc parameter to topology server?

Woody
  • 1
  • Why do you need to pass the DC parameter? Normally that is only used to issue cross-DC queries. If you want to store large amounts of data in Consul, you’re better off storing that in the same DC as the agent you’re communicating with. – Blake Covarrubias Jan 14 '21 at 21:19
  • Thanks for the reply. The problem is Consul's web UI is only listing data that have been placed with DC parameter. Unfortunately, I don't have access to Consul's configuration so I can't change that. I am able to put data to Consul anyways to let say "default namespace" but web UI is not listing this thus I wanted to pass DC parameter in Vitess. – Woody Jan 18 '21 at 08:06
  • You would only see this behavior if the Consul agent you're communicating with is in a different DC than where the key/value objects live. After looking at https://github.com/vitessio/vitess/blob/v9.0.0/go/vt/topo/consultopo/server.go, there does not appear to be a way to specify the Consul DC parameter. I recommend you either configure Vitess to connect to an agent in the same DC which houses your Consul K/V data, or file a feature request with Vitess to allow specifying the DC parameter when initializing the Consul API client. https://pkg.go.dev/github.com/hashicorp/consul/api#Config – Blake Covarrubias Jan 28 '21 at 02:43

0 Answers0