Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not join the cluster use the agent parameter -client #2505

Closed
ghost opened this issue Nov 11, 2016 · 3 comments
Closed

can not join the cluster use the agent parameter -client #2505

ghost opened this issue Nov 11, 2016 · 3 comments

Comments

@ghost
Copy link

ghost commented Nov 11, 2016

I am running two consul servers. When I try to join them in a cluster, I get this error:

getsockopt: connection refused

$ consul join 192.168.99.2
Error connecting to Consul agent: dial tcp 127.0.0.1:8400: getsockopt: connection refused

the boot the consul agent like this

consul agent -server -bootstrap-expect=1 -bind=192.168.99.2 -client=192.168.99.2 -data-dir=/usr/consul -config-dir=/etc/consul.d -node=agent-n2 -datacenter=dc1

consul agent -server -bind=192.168.99.3 -client=192.168.99.3 -data-dir=/usr/consul -config-dir=/etc/consul.d -node=agent-n2 -datacenter=dc1

consul join 192.168.99.2

the ip 192.168.99.3 is my local ip address

the result error is :

Error connecting to Consul agent: dial tcp 127.0.0.1:8400: getsockopt: connection refused

but I use the next command is success join the cluster

consul agent -server -bind=192.168.99.3 -client=127.0.0.1 -data-dir=/usr/consul -config-dir=/etc/consul.d -node=agent-n2 -datacenter=dc1

why ?

This was referenced Nov 30, 2016
@slackpad
Copy link
Contributor

The consul join command is trying to connect to the client listener on the -client address. Generally we don't recommend setting -client to anything that's exposed outside the machine. If you wanted to get the join to work in the first case, use consul join -rpc-addr=192.168.99.2:8400.

@dilipmevada
Copy link

How to resolve this error?
C:\Consul>consul join 192.168.xx.xxx
Error joining address '192.168.xx.xxx': Unexpected response code: 500 (1 error(s) occurred:

  • Failed to join 192.168.xx.xxx: dial tcp 192.168.xx.xxx:8301: i/o timeout)
    Failed to join any nodes.

@slackpad
Copy link
Contributor

Hi @dilipmevada that looks like the server you are trying to join to maybe has a firewall blocking port 8301, or that Consul on that machine isn't listening on the interface you are expecting (check your bind configuration for Consul).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants