user2867237
user2867237

Reputation: 457

clustering in node.js using mesos

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 state) and a load balancer in front of the servers to distribute the 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? What about Apache mesos? 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?

Thanks

Upvotes: 1

Views: 1369

Answers (1)

Skand
Skand

Reputation: 51

My question: is there any suitable distributed module available in Node.js for my work?

Don't know.

I have heard that mesos can abstract multiple physical machines into a single server? is it correct?

Yes. Almost. It allows you to pool resources (CPU, RAM, DISK) across multiple machines, gives you ability to allocate resources for your applications, run and manage the said applications. So you can ask Mesos to run X instances of node.js and specify how much resource does each instance needs. http://mesos.apache.org https://www.cs.berkeley.edu/~alig/papers/mesos.pdf

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?

Admittedly, I don't know anything about node.js or clustering in node.js. Going by http://nodejs.org/api/cluster.html, it just forks off a bunch of child workers and then round robins the connection between them. You have 2 options off the top of my head:

  1. Run node.js on Mesos using an existing framework such as Marathon. This will be fastest way to get something going on Mesos. https://github.com/mesosphere/marathon
  2. Create a Mesos framework for node.js, which essentially does what cluster node.js is doing, but across the machines. http://mesos.apache.org/documentation/latest/app-framework-development-guide/

In both these solutions, you have the option of letting Mesos create as many instances of node.js as you need, or, use Mesos to run cluster node.js on each machine and let it manage all the workers on that machine.

I didn't google, but there might already be a node.js mesos framework out there!

Upvotes: 2

Related Questions