Configuring an erlang cluster

131 views
Skip to first unread message

Michele Sciabarra

unread,
Dec 14, 2008, 4:29:15 PM12/14/08
to think...@googlegroups.com
I sent this email some time ago in the erlang mailing list, and I got no
answer. Because it is related to the article republished by Joel, I post
it again on this list.

----

I am trying to set up an erlang cluster. I am trying to put in a cluster
mochiweb.

What I want to do is to have a master boot server, and slave nodes pick
their code from the master.

I have followed Joel Reymond tutorial in his blog
(http://www.wagerlabs.com/blog/2007/10/setting-up-erla.html)

It works when I start a second node in the same machine.
It does not work when I start a second node in a remote machine.

I have done a .rel and generated a boot script with the local option,
and I am also using cean.
On the master I run (boot_server is a simple module that calls
erl_boot_server:start(...))

/cean/start.sh -name e1 -setcookie xxx -s boot_server

On the slaves I run

/cean/start.sh \
-name e2 -id e2 -setcookie xxx \
-loader inet -hosts 10.0.1.1 -boot /cean/erlang/boot/demoweb -mode
embedded

I get:

** Bad path can't read /cean/erlang/boot
** Bad path can't read /cean/erlang/lib/mochiweb-0.01/ebin
** Bad path can't read /cean/erlang/lib/demoweb-0.01/ebin

Note that running those commands in the same node works, even using a
different erlang installation, not having mochiweb and demoweb installed.

I was expectiing that the inets loader is able to fetch beam code from
the boot server, but this seems not to be the case.

I am afraid I am missing something of basic and fundamental, but reading
the OTP documentation I was unable to figure out how this should work.

Have I to copy all the files in the slave machine?
What is the purpose of the systools:make_tar ?
Should instead generate a tar to allow the boot server to distribuite
the application?

A normal j2ee based cluster is usually able to copy a war file from the
master to the slave nodes automatically. I was expecting something similar.

Any help will be appreciated.

Joel Reymont

unread,
Dec 14, 2008, 4:54:21 PM12/14/08
to think...@googlegroups.com

On Dec 14, 2008, at 9:29 PM, Michele Sciabarra wrote:

> I get:
>
> ** Bad path can't read /cean/erlang/boot
> ** Bad path can't read /cean/erlang/lib/mochiweb-0.01/ebin
> ** Bad path can't read /cean/erlang/lib/demoweb-0.01/ebin


I should update the tutorial since this is the second time I hear
about this issue.

I believe it's a paths issue. Check to see where the files are fetched
from on the remote node and adjust your boot file as needed.

--
http://wagerlabs.com

Michele Sciabarra

unread,
Dec 14, 2008, 5:09:00 PM12/14/08
to think...@googlegroups.com
Joel Reymont ha scritto:
Files on remote node and local node are exactly in the same path.
I checked this tons of times. What I really do not understand how is  the remote code loading supposed to work.

Joel Reymont

unread,
Dec 14, 2008, 8:09:05 PM12/14/08
to think...@googlegroups.com
Michele,

On Dec 14, 2008, at 10:09 PM, Michele Sciabarra wrote:

> Files on remote node and local node are exactly in the same path.
> I checked this tons of times. What I really do not understand how is
> the remote code loading supposed to work.


Trace get_file and get_path in the erl_prim_loader and do it on the
remote node.

Take a look at my t.erl [1] if you don't have a handy tracing module.
I would do it like this

t:t([{erl_prim_loader, get_file}, {erl_prim_loader, get_path}]).

Let me know how it goes but I'm almost positive that tracing gave me
the clue last time. If it does help then I'll have to update the
tutorial. It could be that the boot file need not be compiled in local
mode.

[1] http://github.com/wagerlabs/openpoker/tree/master/src/t.erl

--
http://wagerlabs.com

Reply all
Reply to author
Forward
0 new messages