[erlang-questions] code path when using inet loader

Angel Alvarez clist@REDACTED
Thu Jul 30 19:38:03 CEST 2009


El Jueves, 30 de Julio de 2009 Sebastien Merle escribió:
> Indeed, the path added with -pz are not in the slave code:get_path() list.
> 
> This is troublesome, because it mean the master node has to know
> how it has been setup and replicate the configuration to the slaves.
> It's not very flexible.
> 
> Another option seems to create a .erlang file with code:add_pathz() in it,
> this is working but then you loose any custom configuration added to
> $HOME/.erlang and you have to run erl in this directory.
> So it's not a lot better in the end.

well, you can use something like:

cluster_add_pathz(NewPath) ->
        %% extract remote all nodes except master
        RemoteNodes = [X || X <- pool:get_nodes(), X =/= node()],
        %% foreach node do proper path loading
        lists:foreach(fun(Node) -> rpc:call(Node, code, add_pathz, [NewPath]). end, RemotesNodes).

where pool:get_nodes can be changes to nodes() when no pool is used...

*Warning* Untested code (written on the fly)

/Angel

> 
> On Thu, Jul 30, 2009 at 6:46 PM, Angel Alvarez<clist@REDACTED> wrote:
> > El Miércoles, 29 de Julio de 2009 Sebastien Merle escribió:
> >> Hi,
> >>
> >> I'm experimenting with remote code server using a master node
> >> with erl_boot_server that starts slave nodes with arguments "-loader inet".
> >>
> >> It seems that if the master is started with -pz arguments, the beam files
> >> from the added path cannot be loaded by the slave nodes.
> >>
> >> If I just start the master in the directory where the beam files are instead
> >> of adding the path with -pz, the slave can load the beam files.
> >>
> >> Any hints on why this is happening ?
> >
> > ¿does code:get_path() return correct info on slaves?
> >
> > Maybe -pz arguments need to be passed to slave. i think slave code still controls loading but defers
> > actual file loading to master server, so proper -pz must be passed on slave startup.
> >
> > /angel
> >
> >>
> >> Regards,
> >> Sebastien Merle.
> >>
> >> ________________________________________________________________
> >> erlang-questions mailing list. See http://www.erlang.org/faq.html
> >> erlang-questions (at) erlang.org
> >>
> >>
> >
> >
> >
> > --
> > Agua para todo? No, Agua para Todos.
> > ->>-----------------------------------------------
> >    Clist UAH a.k.a Angel
> > ---------------------------------[www.uah.es]-<<--
> >
> > No le daría Cocacola Zero, ni a mi peor enemigo. Para eso está el gas Mostaza que es mas piadoso.
> >
> > ________________________________________________________________
> > erlang-questions mailing list. See http://www.erlang.org/faq.html
> > erlang-questions (at) erlang.org
> >
> >
> 
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
> 
> 



-- 
No imprima este correo si no es necesario. El medio ambiente está en nuestras manos.
->>-----------------------------------------------
    Clist UAH a.k.a Angel
---------------------------------[www.uah.es]-<<--

Warning: Microsoft_bribery.ISO contains OOXML code.


More information about the erlang-questions mailing list