Clustering in node.js using mesos

203 views
Skip to first unread message

Farshad P

unread,
Mar 5, 2015, 2:55:45 PM3/5/15
to nod...@googlegroups.com

I'm working on a project with Node.js that involves a server. Now due to large number of jobs, I need to perform clustering to divide the jobs between different servers (different physical machines). Note that my jobs has nothing to do do with internet, so I cannot use stateless connection (or redis to keep the states) and a load balancer in front of the servers to distribute the incoming connection...

I already read about the "cluster" module, but, from what i understood, it seems to scale only on multiprocessors on the same machine.

My question: is there any suitable distributed module available in Node.js for my work? I have heard that mesos can abstract multiple physical machines into a single server? is it correct? If yes, it is possible to use the node.js cluster module on top of the mesos, since now we have only one virtual server?

Farshad P

unread,
Mar 5, 2015, 4:17:03 PM3/5/15
to nod...@googlegroups.com

Nathan

unread,
Mar 6, 2015, 11:38:43 AM3/6/15
to nod...@googlegroups.com
The simplest way to use Mesos with Node.js would be to Dockerize your Node.js application. See this page about launching a docker container on Mesos: https://mesosphere.com/docs/tutorials/launch-docker-container-on-mesosphere/

Christian Taltas

unread,
Mar 6, 2015, 11:38:43 AM3/6/15
to nod...@googlegroups.com
Hi 

Way don't you use an internal load-balancer !
This is the best way to scale your platform.

Regards 
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 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 unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/27f7a8a5-29d8-48a4-b2f6-fa49f2ca677d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Christian Taltas
KPMG Technologies Services - Directeur Général



Ryan Schmidt

unread,
Mar 6, 2015, 11:38:59 AM3/6/15
to nod...@googlegroups.com
You are right that the cluster module is used to start multiple copies of a process on a single physical server, and that the master receives incoming network sockets and distributes them to the children.

If you need to start processes on more than one physical server, then you need something else. nginx is a popular web server that can be used in front of a bunch of node processes, which can be on any number of physical servers.

If your processes are not serving a web site, or are not serving any kind of network socket at all, then nginx and cluster are not what you need.

I am not familiar with mesos. The last time I was looking into ways to distribute work among multiple processes on multiple computers (which was a few years ago), I used Kue:

http://learnboost.github.io/kue/

The idea was that a master process would create units of work, which would get written into a redis database, and then a pool of workers, which could be on as many different physical machines as you like, would each pick off units of work and do them, and return their results to the database, which would give them to the master, which could then do what it liked with the results as they came in.

Mike Michel

unread,
May 19, 2016, 10:18:19 AM5/19/16
to nodejs
our platform https://sloppy.io is based on mesos and our application on nodejs. if you can manage to split your app in pieces/microservices and everything runs for you well locally (docker-compose) you can run it perfectly in mesos. maybe helpfull: dockerizing nodejs with docker-compose https://goo.gl/BS31Qw
Reply all
Reply to author
Forward
0 new messages