Erlang/OTP Forums

Author Message

<  Erlang questions mailing list  ~  Two network interfaces.

Guest
Posted: Tue Sep 13, 2011 1:25 pm Reply with quote
Guest
Hi all.

Let's imagine that we have two machines A and B with erlang VM.

On each erlang machine there is application which uses mnesia database. The database is replicated between nodes.
Each node has two interfaces "I1" which is extremely fast and "I2" which is slow. There is also a bunch of erlang nodes which are clients
for A and B nodes and they are using native erlang interface.

I was trying to configure erlang nodes A and B to utilize this two interfaces but without any effect.
How to connect nodes A i B with fast link (for mnesia replication) and at this same time connect them with slow link with external clients?

I've tried:


machine A:

erl -name master -setcookie secret

inet:getif():
{ok,[{{192,168,1,10},{192,168,255,255},{255,255,0,0}},
{{10,132,24,10},{10,132,25,255},{255,255,254,0}},
{{127,0,0,1},{0,0,0,0},{255,0,0,0}}]}

machine B:

erl -name replica -setcookie secret

net_adm:ping('master@my.domain'):
pong

net_adm:ping('master@192.168.1.10'):
pang

Why? What I'm doing wrong?

best regards

----------------------------------------------------------------
Skoda Octavia z 2009 roku juz za 11 tys. zl
http://linkint.pl/f2a36
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
Post received from mailinglist
Guest
Posted: Tue Sep 13, 2011 4:12 pm Reply with quote
Guest
On Tue, Sep 13, 2011 at 03:25:42PM +0200, Krzysztof Blachowski wrote:
> Hi all.
>
> Let's imagine that we have two machines A and B with erlang VM.
>
> On each erlang machine there is application which uses mnesia database. The database is replicated between nodes.
> Each node has two interfaces "I1" which is extremely fast and "I2" which is slow. There is also a bunch of erlang nodes which are clients
> for A and B nodes and they are using native erlang interface.
>
> I was trying to configure erlang nodes A and B to utilize this two interfaces but without any effect.
> How to connect nodes A i B with fast link (for mnesia replication) and at this same time connect them with slow link with external clients?
>
> I've tried:
>
>
> machine A:
>
> erl -name master -setcookie secret
>
> inet:getif():
> {ok,[{{192,168,1,10},{192,168,255,255},{255,255,0,0}},
> {{10,132,24,10},{10,132,25,255},{255,255,254,0}},
> {{127,0,0,1},{0,0,0,0},{255,0,0,0}}]}
>
> machine B:
>
> erl -name replica -setcookie secret
>
> net_adm:ping('master@my.domain'):
> pong
>
> net_adm:ping('master@192.168.1.10'):
> pang
>
> Why? What I'm doing wrong?

Since the name of the node is 'master@my.domain', it won't respond to
'master@192.168.1.10'.

What might work is changing the DNS resolution on either the clients or
the hosts. If the interfaces are mapped as follows:

I1: 192.168.1.10
I2: 10.132.24.10

The clients will do a DNS lookup on 'my.domain' and get 10.132.24.10. On
the mnesia nodes, force the resolution to the fast interface by adding
an entry to the /etc/hosts file:

192.168.1.10 my.domain

Or if you don't want to change the name lookup for everything on the
host, you can set it just for Erlang, something like:

cat<<EOF>erl_inetrc
{host, {192,168,1,10}, ["my.domain"]}.
{lookup, [file, dns]}.
EOF

The run:

erl -name master -kernel inetrc '"erl_inetrc"'

It's all explained here: http://www.erlang.org/doc/apps/erts/inet_cfg.html
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions
Post received from mailinglist
Guest
Posted: Fri Sep 16, 2011 6:48 pm Reply with quote
Guest
One alternative is to do interface selection using a static route.

Sincerely,


jw

--
Americans might object: there is no way we would sacrifice our living standards for the benefit of people in the rest of the world. Nevertheless, whether we get there willingly or not, we shall soon have lower consumption rates, because our present rates are unsustainable.



On Tue, Sep 13, 2011 at 6:25 AM, Krzysztof Blachowski <kblachowski@interia.eu (kblachowski@interia.eu)> wrote:
Quote:
Hi all.

Let's imagine that we have two machines A and B with erlang VM.

On each erlang machine there is application which uses mnesia database. The database is replicated between nodes.
Each node has two interfaces "I1" which is extremely fast and "I2" which is slow. There is also a bunch of erlang nodes which are clients
for A and B nodes and they are using native erlang interface.

I was trying to configure erlang nodes A and B to utilize this two interfaces but without any effect.
How to connect nodes A i B with fast link (for mnesia replication) and at this same time connect them with slow link with external clients?

I've tried:


machine A:

erl -name master -setcookie secret

inet:getif():
{ok,[{{192,168,1,10},{192,168,255,255},{255,255,0,0}},
    {{10,132,24,10},{10,132,25,255},{255,255,254,0}},
    {{127,0,0,1},{0,0,0,0},{255,0,0,0}}]}

machine B:

erl -name replica -setcookie secret

net_adm:ping('master@my.domain'):
pong

net_adm:ping('master@192.168.1.10 (master@192.168.1.10)'):
pang

Why? What I'm doing wrong?

best regards

----------------------------------------------------------------
Skoda Octavia z 2009 roku juz za 11 tys. zl
http://linkint.pl/f2a36
_______________________________________________
erlang-questions mailing list
erlang-questions@erlang.org (erlang-questions@erlang.org)
http://erlang.org/mailman/listinfo/erlang-questions




Post received from mailinglist

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