Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  use inetrc to add entries to perceived /etc/hosts

Guest
Posted: Tue Oct 04, 2011 12:14 pm Reply with quote
Guest
Hi everybody,

we are working on a distributed erlang project. We want to have as little
dependencies on specific infrastructure as possible.

This is why we assume that

1. There is no DNS server running providing a naming service.
2. Entries in /etc/hosts on the node hosts are insufficient to provide
naming for all other node hosts.

We need to make it possible for all hosts to reach each other and to start
all nodes from a central host. We could start all nodes via ssh,
identifying hosts via IP addresses, but as we understand it slave:start/1
is made for this job and only works with hostnames.

Searching for a solution we stumbled across "-kernel inetrc". The idea is
to scp an inetrc to all hosts and then start nodes with slave:start and
get them to read their local inetrc on startup.

We tried starting a node locally with the following command:

> erl -rsh ssh -sname test -kernel inetrc '"./erl_inetrc"'

For the contents of erl_inetrc we tried the following two solutions, but
didn't get it to work.
Running slave:start(host1). on host2 always gave the following error:
> {error,timeout}
But a simple "ssh 192.168.2.100" works.

1. everything in erl_inetrc

erl_inetrc:
> {host, {192,168,2,100}, ["host1"]}.
> {host, {192,168,2,101}, ["host2"]}.

2. an additional hosts file

erl_inetrc:
> {file, hosts, "./hosts"}.

hosts file:
> 192.168.2.100 host1
> 192.168.2.101 host2

Any ideas what we did wrong?

Best Regards
Florian Grabbe
Philip M
Guest
Posted: Tue Oct 04, 2011 1:27 pm Reply with quote
Guest
On Tue, Oct 04, 2011 at 02:14:45PM +0200, Philip M
Guest
Posted: Tue Oct 04, 2011 2:31 pm Reply with quote
Guest
On Tue, 04 Oct 2011 15:28:23 +0200, Michael Santos
<michael.santos@gmail.com> wrote:

> On Tue, Oct 04, 2011 at 02:14:45PM +0200, Philip M
Guest
Posted: Tue Oct 04, 2011 4:35 pm Reply with quote
Guest
On Tue, Oct 04, 2011 at 04:31:19PM +0200, Philip M

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum