Running handler scripts on "EventMemberJoin"

67 views
Skip to first unread message

Ben Booth

unread,
Oct 6, 2014, 10:02:39 AM10/6/14
to consu...@googlegroups.com
Hi.

Is is possible to run handler scripts on "EventMemberJoin" and "EventMemberLeave"?
This was possible with Serf, but I can't find any documentation for Consul.

Thanks,

Ben

Armon Dadgar

unread,
Oct 6, 2014, 2:15:11 PM10/6/14
to consu...@googlegroups.com, Ben Booth
Ben,

Serf had a much more node-centric view of things like Consul has a more service-centric view.
You can use watches to monitor nodes if you want, but it doesn’t work quite the same way.
The nodes are only reaped after leaving or failing for 72 hours, so they don’t trigger at the same
rate.

Instead, you can use the watch for a specific service. The service watch can be filtered on
“passingonly”, so that you only get the live/healthy members. This way the Join/Leave is
much more immediate. The big difference is the service vs node granularity however.

Another option is to watch the “checks” and specifically the “serfHealth” for nodes joining,
leaving and failing.

Hope that helps!


Best Regards,
Armon Dadgar
--
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.
For more options, visit https://groups.google.com/d/optout.

Ben Booth

unread,
Oct 7, 2014, 8:00:51 AM10/7/14
to consu...@googlegroups.com
Thanks for the reply.

I'll try to rethink my strategy then. :)
Loving Consul btw

Ben
Reply all
Reply to author
Forward
0 new messages