hook.io on AWS EC2

155 views
Skip to first unread message

Achi Chen

unread,
Apr 27, 2012, 12:01:41 AM4/27/12
to Hook.io
Hi all,

I'm trying to setup a server cluster on AWS EC2, each server listening
on events coming from others.

hook.io seems to be the perfect solution as the communication channel
among servers. However, the auto-discover using mdns doesn't work due
to EC2 not support IP multicast. And I'm looking for solution to
this.

Our alternative architecture is to use one hook as the 'server hook',
and other servers exchange events via it, just like the "For Dummies"
article says http://ejeklint.github.com/2011/09/23/hook.io-for-dummies-part-1-overview/.
But I could find any way to ask a hook to connect to a remote server
hook by specifying its IP.

And I am not quite sure if this is what I need:
https://github.com/hookio/hook.io/blob/master/examples/transports/couchdb-event-transport.js.

Would you guys give me some suggestion?
Great Thanks!!

Marak Squires

unread,
Apr 27, 2012, 12:06:28 AM4/27/12
to hoo...@googlegroups.com
Hook.connect and Hook.listen should both accept explicit connection parameters ( hook-host, hook-port, hook-socket )

You should be able to use these options to connect to hooks based on IP and PORT. No need to use CouchDB yet.

Once you've gotten them connected, using Hook.query will probably be useful for you.

--
-- 
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.

Achi Chen

unread,
Apr 27, 2012, 1:35:13 AM4/27/12
to Hook.io
Hi Marak,

In fact, I did have tried setting 'hook-host' in config before my
original post, and it failed.

But it turns out to be caused by my stupid mistakes:
1) in server hook, I have to specify 'hook-host' with the actual IP
rather than '127.0.0.1', it won't listen to all available IPs
2) in client hook, I have to use connect() rather than start(), which
tried connecting to others only when local 5000 port is occupied.

Now it works great. It's my bad.
Thanks~~

Now here comes the HA issue that without auto-discovery by mdns, it is
a single-point-of-failure architecture. We might give a try to use
other mechanism, e.g. hadoop zookeeper, to help hooks discovering each
other in a non-multicast environment.


On Apr 27, 12:06 pm, Marak Squires <marak.squi...@gmail.com> wrote:
> Hook.connect and Hook.listen should both accept explicit connection
> parameters ( hook-host, hook-port, hook-socket )
>
> You should be able to use these options to connect to hooks based on IP and
> PORT. No need to use CouchDB yet.
>
> Once you've gotten them connected, using Hook.query will probably be useful
> for you.
>
>
>
>
>
>
>
>
>
> On Thu, Apr 26, 2012 at 9:01 PM, Achi Chen <achichen...@gmail.com> wrote:
> > Hi all,
>
> > I'm trying to setup a server cluster on AWS EC2, each server listening
> > on events coming from others.
>
> > hook.io seems to be the perfect solution as the communication channel
> > among servers. However, the auto-discover using mdns doesn't work due
> > to EC2 not support IP multicast. And I'm looking for solution to
> > this.
>
> > Our alternative architecture is to use one hook as the 'server hook',
> > and other servers exchange events via it, just like the "For Dummies"
> > article says
> >http://ejeklint.github.com/2011/09/23/hook.io-for-dummies-part-1-over...
> > .
> > But I could find any way to ask a hook to connect to a remote server
> > hook by specifying its IP.
>
> > And I am not quite sure if this is what I need:
>
> >https://github.com/hookio/hook.io/blob/master/examples/transports/cou...
> > .
>
> > Would you guys give me some suggestion?
> > Great Thanks!!
>
> --
> --
> Marak Squires
> Co-founder and Chief Evangelist
> Nodejitsu, Inc.
> marak.squi...@gmail.com

Marak Squires

unread,
Apr 27, 2012, 2:50:00 PM4/27/12
to hoo...@googlegroups.com
Now here comes the HA issue that without auto-discovery by mdns, it is
a single-point-of-failure architecture. We might give a try to use
other mechanism, e.g. hadoop zookeeper, to help hooks discovering each
other in a non-multicast environment.

--autoheal option should work fine without MDNS.  
-- 
Marak Squires
Reply all
Reply to author
Forward
0 new messages