Is there a good example of how to do autoheal across different hosts?

20 views
Skip to first unread message

Mooky

unread,
Aug 29, 2012, 10:38:26 AM8/29/12
to Hook.io
I am trying to create a cluster of hooks that send messages and listen
to each other's messages - without having a single point-of-failure.
It appears that autoheal is what I want - but I havent been able to
work out from docs, examples, mailing lists, blog posts, etc how this
is done across hosts.
I have seen references to mdns and "-m" but havent figured out how to
do this in code.
I have seen references to using Hook.listen() and Hook.connect() - but
its unclear to me how a restarting node would know where to connect()
if the server had failed (and another node had now become the server)

With a bit of trial and error, I have a simple case working of a mesh
of autoheal-ing hooks that works on the same host.

============================
var Hook = require('hook.io').Hook;
var hooky = new Hook({
name: "hooky",
silent: false,
autoheal: true
});
hooky.start();
============================

I can start a number of them on the same host, and everything works as
I expect.

Is there an example of what I need to change above do do this across
hosts?

Mooky

unread,
Aug 29, 2012, 11:11:53 AM8/29/12
to Hook.io
I have figured out mdns is enabled by as follows:
var hooky = new Hook({
name: "hooky",
silent: false,
autoheal: true,
m: true,
});

How can it be done without mdns? (ie the issues regarding restarting I
raised)

Cheers.
Reply all
Reply to author
Forward
0 new messages