How does retry-join works for consul agent in client mode ?

1,317 views
Skip to first unread message

nss pradeep

unread,
Jun 9, 2016, 2:01:30 PM6/9/16
to Consul
Hi,

I would like to understand how retry-join will work for a consul agent in client mode ?

We have 3 consul agents in server mode and 1 consul agent in client mode. All 3 consul agents in server mode are started and formed a cluster.

During the start of consul in client mode we pass the flag -retry-join so that it keeps trying to find consul agents in server mode.

Let us consider it found the consul agents in server mode and joined them. Now in its consul member list we have 3 consul agents in server mode with status as "alive".

Now if we gracefully exit all 3 consul agents in server mode then in the consul member list of the consul agent in client mode we see the status as "left" for these 3 servers.

Based on my understanding even if i rebuild all the 3 consul agents in server mode with same ip, the consul agent in client mode will not retry to join them because it has flagged these consul agents as "left".  

Also if i rebuild all the 3 consul agents in server mode with different ip, the consul agent in client mode will not retry to join them because it does not know these new ip addresses. 

In these scenario, i have to either restart the consul agent in client mode or manually perform a "consul join" to one of the consul node in server mode.

Also i would like to confirm if 3 statutes for consul agents are "alive", "left", "failed".

Please let me know if my understanding is correct or not.

Thanks,
Pradeep NSS

Ryan Uber

unread,
Jun 13, 2016, 1:51:51 PM6/13/16
to consu...@googlegroups.com
Hi Pradeep,

-retry-join mode is a one-shot attempt to join the given address, meaning, the agent will attempt and retry until the initial join is successful, or the max number of retries is exhausted. It is not intended to continue join attempts after that point. During a graceful exit, the agent broadcasts an intent-to-leave message to the cluster, letting the others know it is going away. In order to become a cluster member again, a subsequent join will need to be issued. You can issue a "consul join" from any node in the same datacenter, client or server mode is not important in this case.

Hope that helps!
- Ryan

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/4518ef2f-c333-4fc9-b520-e6a6440f908a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nss pradeep

unread,
Jun 15, 2016, 12:31:58 AM6/15/16
to consu...@googlegroups.com
Hi Ryan,

Thank you for the explanation. I went through the code and found the same. 

Thanks
Pradeep NSS
Reply all
Reply to author
Forward
0 new messages