Prudhvi Chowdary Are
Prudhvi Chowdary Are

Reputation: 59

Error querying Consul agent: Get http://127.0.0.1:8500/v1/kv/vault?recurse=: dial tcp 127.0.0.1:8500: connect: connection refused

~]$ /apps/bin/consul/consul kv export vault

Error querying Consul agent: Get http://127.0.0.1:8500/v1/kv/vault?recurse=: dial tcp 127.0.0.1:8500: connect: connection refused

I'm trying to export entire vault/ folder from consul.

seeing the below error

Error querying Consul agent: Get http://127.0.0.1:8500/v1/kv/vault?recurse=: dial tcp 127.0.0.1:8500: connect: connection refused

Upvotes: 2

Views: 3570

Answers (1)

hanna
hanna

Reputation: 655

You have to change the http/s address of Consul agent to which you're trying to connect. The default one is http://127.0.0.1:8500 and it doesn't work as you can see in the error.

To do this, set the following environment variable using the export command:

export CONSUL_HTTP_ADDR = <http/s_address_to_consul_agent>

If connecting via TLS, set also:

export CONSUL_CACERT = <path_to_cert_file>

Alternatively, you can set the above values as the parameters to consul kv export command:

consul kv export -http-addr=<http/s_address_to_consul_agent> -ca-file=<path_to_cert_file> 

Upvotes: 1

Related Questions