1
votes

I have a consul server running on ubuntu box via vagrant and virtual box It appears to be running correctly:

running server

I then ssh onto the box and run:

consul members

but I get this output:

enter image description here

What am I doing wrong? I cant figure this out as I am following consul tutorial, and it seems to have no issue with this

Adding config.json file

{
    "bootstrap": true,
    "server": true,
    "datacenter": "dc1",
    "data_dir": "/var/consul",
    "encrypt": "Dt3P9SpKGAR/DIUN1cDirg==",
    "log_level": "INFO",
    "enable_syslog": true,
    "bind_addr": "172.20.20.10",
    "client_addr": "172.20.20.10"
}
2
You should post a link to the consul tutorial you are following. - ahus1
Tutorial I am using to learn commands is consul.io/intro/getting-started/install.html, however this does not configure everything I have in config.json above - Noel

2 Answers

2
votes

Consul defaults to the client address of 127.0.0.1, but you have configured your server to listen on 172.20.20.10 for clients.

You'll need to put the option -rpc-addr to your command line invocation as well to make it work:

consul members -rpc-addr=172.20.20.10:8400

I'm also the author of an example Consul setup with Vagrant and Saltstack, maybe you want to have a look at the Github repository.

2
votes

Run the following command to start consul in bootstrap mode.

consul agent -config-dir ~/consul-config/server -ui-dir ~/consul-ui -bootstrap true -client=0.0.0.0

To setup consul on a single instance follow this blog post or video tutorial