I am a programmer. Therefore, things that “just work” always amaze me. I had this feeling when I became acquainted with the Erlang Pool. The setup requires some attention, but afterwards, the mechanism is “offensively” simple.
To run the Erlang pool, you need the following:
- A set of computers with the same Erlang environment, one of which will be the main
- All computers must have code that will be run.
- File with Erlang hosts on the host computer (usually ~ / .hosts.erlang)
- All computers must have the same Erlang-cookie (usually ~ / .erlang.cookie)
- The host computer must have RSH or SSH no-password-required access to all other computers.
- The Erlang shell on the host computer must be named, since she creates a node
That's all. Once everything is ready, run a shell on the host computer and execute:
pool:start(Name).
And so! You have your own Ad-hoc, load-balancing, distributed pool of computers. You do not need to run nodes on other computers: Erlang will do it for you. The following command on the main node will start the process with the function and arguments on the least loaded node:
pool:pspawn(Mod, Func, Args).
I called it “insultingly simple” because it is an insult to all bloated, commercial, expensive BPEL-for-Web-Services-on-J2EE (or .NET) application servers, etc. We are too accustomed to "graphic editors that generate XML, which generates code that is packaged with a manifest and sent to a special server." When someone comes up and says, “Hey, the shell and plain-text config is all you need,” this is a bit shocking.
Keep It Simple, Stupid.