g0t4 / consul-getting-started

This is a sample repo of examples for getting started with Consul. It even includes a multi datacenter example with 14 VMs to allow you to simulate failures in a multi DC environment!
81 stars 71 forks source link

i/o timeout with port 8301 #5

Closed neelamari closed 7 years ago

neelamari commented 7 years ago

Following through course. Got consul-server up and running consul agent -dev -advertise 172.20.20.31

Tried next step of running agent from desktop (mac) consul agent -config-file desky.json

Get timeout errors and

   2017/02/28 21:50:00 [INFO] serf: EventMemberJoin: neelamari 172.20.20.1
    2017/02/28 21:50:00 [WARN] manager: No servers available
    2017/02/28 21:50:00 [ERR] agent: failed to sync remote state: No known Consul servers
    2017/02/28 21:50:00 [INFO] agent: Joining cluster...
    2017/02/28 21:50:00 [INFO] agent: (LAN) joining: [172.20.20.31]
    2017/02/28 21:50:10 [INFO] agent: (LAN) joined: 0 Err: 1 error(s) occurred:

* Failed to join 172.20.20.31: dial tcp 172.20.20.31:8301: i/o timeout
    2017/02/28 21:50:10 [WARN] agent: Join failed: <nil>, retrying in 30s
    2017/02/28 21:50:24 [WARN] manager: No servers available
    2017/02/28 21:50:24 [ERR] agent: failed to sync remote state: No known Consul servers

Is there any needs to open ports in the server. The default image seems to have firewall disabled. Appreciate help.

g0t4 commented 7 years ago

Can you ping the server from your desktop? on 172.20.20.31?

On Wed, Mar 1, 2017 at 12:53 AM, neelamari notifications@github.com wrote:

Following through course. Got consul-server up and running consul agent -dev -advertise 172.20.20.31

Tried next step of running agent from desktop (mac) consul agent -config-file desky.json

Get timeout errors and

2017/02/28 21:50:00 [INFO] serf: EventMemberJoin: neelamari 172.20.20.1 2017/02/28 21:50:00 [WARN] manager: No servers available 2017/02/28 21:50:00 [ERR] agent: failed to sync remote state: No known Consul servers 2017/02/28 21:50:00 [INFO] agent: Joining cluster... 2017/02/28 21:50:00 [INFO] agent: (LAN) joining: [172.20.20.31] 2017/02/28 21:50:10 [INFO] agent: (LAN) joined: 0 Err: 1 error(s) occurred:

  • Failed to join 172.20.20.31: dial tcp 172.20.20.31:8301: i/o timeout 2017/02/28 21:50:10 [WARN] agent: Join failed: , retrying in 30s 2017/02/28 21:50:24 [WARN] manager: No servers available 2017/02/28 21:50:24 [ERR] agent: failed to sync remote state: No known Consul servers

Is there any needs to open ports in the server. The default image seems to have firewall disabled. Appreciate help.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/g0t4/consul-getting-started/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK_3aT6B8egmH4_8f45if3bn_hn20NTks5rhQfhgaJpZM4MPP-c .

neelamari commented 7 years ago

Hi Wes, couldn't ping. it times out

neelamari commented 7 years ago

Tried other samples from git and didn't work as well. Reinstalled vagrant and virtualbox and then everything worked. Thank you.

g0t4 commented 7 years ago

Sometimes virtualbox networking builds up cruft and needs cleaned out to fix things too. I believe at one point I found it had two of the same networks set up with the same subnets and that was causing me grief :)

On Thu, Mar 2, 2017 at 12:55 AM, neelamari notifications@github.com wrote:

Tried other samples from git and didn't work as well. Reinstalled vagrant and virtualbox and then everything worked. Thank you.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/g0t4/consul-getting-started/issues/5#issuecomment-283563874, or mute the thread https://github.com/notifications/unsubscribe-auth/AAK_3S6Dmws_TBrmwIQDuOqd6Gin2aNTks5rhlnTgaJpZM4MPP-c .

ram-devsecops commented 7 years ago

Hi @g0t4 , I'm getting similar error unable to join the consul-server. I'm able to ping the consul-server ip from my mac..Could you pls let me know how to fix this?

[consul-lab user$ consul agent -config-file consul.json ==> Starting Consul agent... ==> Starting Consul agent RPC... ==> Consul agent running! Version: 'v0.7.5' Node ID: '0badd3ca-3553-380f-8a09-3b02ba961b45' Node name: '-MAC' Datacenter: 'dc1' Server: false (bootstrap: false) Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400) Cluster Addr: 172.20.20.1 (LAN: 8301, WAN: 8302) Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false Atlas:

==> Log data will now stream in as it occurs:

2017/03/03 18:52:38 [INFO] serf: EventMemberJoin:MAC 172.20.20.1
2017/03/03 18:52:38 [INFO] agent: Joining cluster...
2017/03/03 18:52:38 [INFO] agent: (LAN) joining: [172.20.20.31]
2017/03/03 18:52:38 [WARN] manager: No servers available
2017/03/03 18:52:38 [ERR] agent: failed to sync remote state: No known Consul servers
2017/03/03 18:52:48 [INFO] agent: (LAN) joined: 0 Err: 1 error(s) occurred:
g0t4 commented 7 years ago

@rammaram06 did you check vbox networking for issues? see above discussion

neelamari commented 7 years ago

If you are using new version of consul (0.7.5), one thing I did which worked for me was to use -bind instead of -advertise

--instead of consul agent -dev -advertise 172.20.20.31 -- use consul agent -dev -bind 172.20.20.31 -node consul-server

Once I made this change, worked for me.

ram-devsecops commented 7 years ago

@neelamari Thank you, it worked after using bind.

roberto-belardo commented 7 years ago

Same thing here. After changin advertise with bind it worked without problems.