Clusterizing an application without the app being aware it's in a cluster?

30 views
Skip to first unread message

Chris Paterson

unread,
Jan 24, 2012, 3:03:17 PM1/24/12
to nodejs
Hello, I'm looking for a way to run an app 'clusterized' without
having the app aware that it's being run in a cluster. Is this
possible? I've been trying a few things with no avail... first I
tried creating a script that uses node.js cluster and simply sucks in
the app that you point to via commanline arguments. When it spins
through and forks, the worker process just spins up the server. It
seems though that this creates a port conflict, I'm not sure why.
Well actually I'm not sure if it's a port conflict, I keep getting
'cannot read property 'port' of null'. My next course of action was
to create a module that you require in the app that essentially does
the same thing to see if there was a difference. That didn't work,
then to copy and paste the code directly in the app and it still
doesn't work. The app I'm using is an express server. It'll run the
first worker, then the subsequent workers die because they can't find
the "port of null". Any help would be greatly appreciated!

Richard Marr

unread,
Jan 25, 2012, 10:22:09 AM1/25/12
to nod...@googlegroups.com
Do you mean the core cluster module in Node 0.6?

It sounds like you want to take a look at TJ's pre-0.6 Cluster module, which is designed to share load between multiple processes whilst avoiding port conflicts:


Not all of the functionality from learnboost/cluster is available in 0.6 core cluster (and vice versa).



--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en



--
Richard Marr
Reply all
Reply to author
Forward
0 new messages