<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6002.18591" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=100172609-25052012><FONT face=Arial
color=#0000ff size=2>It is somewhat offtopic as I do not believe David
experenced this, but I have similar disconnection when Windows goes to
sleep. After the wake-up, the nodes do not see each other. Does anyone have any
idea how to fix this?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=100172609-25052012><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=100172609-25052012><FONT face=Arial
color=#0000ff size=2>Thanks,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=100172609-25052012><FONT face=Arial
color=#0000ff size=2>Jozsef</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> erlang-questions-bounces@erlang.org
[mailto:erlang-questions-bounces@erlang.org] <B>On Behalf Of </B>Martynas
Pumputis<BR><B>Sent:</B> Friday, May 25, 2012 16:24<BR><B>To:</B> David
Mercer<BR><B>Cc:</B> erlang-questions@erlang.org<BR><B>Subject:</B> Re:
[erlang-questions] What causes nodes to become
disconnected/reconnected?<BR></FONT><BR></DIV>
<DIV></DIV>Erlang doesn't detect net splits by itself. You could start looking
at net_kernel:set_net_ticktime/2 (try to increase this value if your node is
suffering from high load/traffic) and kernel/src/dist_utils.erl to get a grasp
how erlang handles node connections.<BR><BR>Martynas<BR><BR>
<DIV class=gmail_quote>On Thu, May 24, 2012 at 6:23 PM, David Mercer <SPAN
dir=ltr><<A href="mailto:dmercer@gmail.com"
target=_blank>dmercer@gmail.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV lang=EN-US vlink="purple" link="blue">
<DIV>
<P class=MsoNormal>(Yes, I am still working on my issue with a distributed
application that keeps losing its connection to the other
node.)<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P class=MsoNormal>It is not a problem only when I have 2 nodes on the
<I>same</I> host. I was running the nodes on <I>different</I> hosts last
night, and this morning the failover node had lost its connection to the main
and so had started its own instance of the application. Calling <SPAN
style="FONT-FAMILY: Consolas">nodes()</SPAN> on the failover returned <SPAN
style="FONT-FAMILY: Consolas">[]</SPAN>.<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P class=MsoNormal>Then I started a new node on the same host as the main (to
see if it would restore the connections), and, yes, it did. After
starting the third node, <SPAN style="FONT-FAMILY: Consolas">nodes()
</SPAN>now on the failover node returns a list of two nodes, the two on the
main host. However, the application on the failover node did not shut
down, and so it is still running on both the main and failover
nodes.<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P class=MsoNormal>To summarize:<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P><U></U><SPAN>1.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><U></U>Distributed application running on a node on host A
(“main@A”), failover on node on host B (“failover@B”).<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P><U></U><SPAN>2.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><U></U>At some point, <I>failover@B</I> becomes disconnected
from <I>main@A</I>, and the application starts on <I>failover@B</I>. Now
there are two instances of the application running.<U></U><U></U></P>
<P><U></U><U></U> </P>
<P><U></U><SPAN>3.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><U></U>From a network point of view, there is still (or again) a
valid network connection between hosts A and B. I can’t say for sure if
some network/firewall/other issue caused a temporary disconnect, but I can say
that by the time I got in this morning, when the application was running on
both nodes, there was a firm network connection between the two
hosts.<U></U><U></U></P>
<P><U></U><U></U> </P>
<P><U></U><SPAN>4.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><U></U>Calling <SPAN
style="FONT-FAMILY: Consolas">nodes()</SPAN> on <I>failover@B</I> returns
<SPAN style="FONT-FAMILY: Consolas">[]</SPAN>.<U></U><U></U></P>
<P><U></U><U></U> </P>
<P><U></U><SPAN>5.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><U></U>A new (failover) node was started on host A
(“failover@A”). It does not start the application (which is correct,
since it is already running, albeit on <I>both</I> other nodes instead of just
one).<U></U><U></U></P>
<P><U></U><U></U> </P>
<P><U></U><SPAN>6.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><U></U>Calling <SPAN
style="FONT-FAMILY: Consolas">nodes()</SPAN> on <I>failover@B</I> now returns
<SPAN
style="FONT-FAMILY: Consolas">[failover@A,main@A]</SPAN>.<U></U><U></U></P>
<P><U></U><U></U> </P>
<P><U></U><SPAN>7.<SPAN
style="FONT: 7pt 'Times New Roman'">
</SPAN></SPAN><U></U>The application, however, is still running on
<I>failover@B</I>, despite the fact that nodes/0 reports a connection to
<I>main@A</I>.<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P class=MsoNormal>I don’t need someone to diagnose this for me. If
someone could just educate me a little on how the connections work, how net
splits are detected and nodes disconnected, etc., I might be able to take it
from there. Anyone know enough and have the time to type out a little
blurb? I can read source code, but having a little background knowledge
would help put it into context for me.<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P class=MsoNormal>Thank-you!<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P class=MsoNormal>Cheers,<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P class=MsoNormal>David<U></U><U></U></P>
<P class=MsoNormal><U></U><U></U> </P>
<P
class=MsoNormal><U></U><U></U> </P></DIV></DIV><BR>_______________________________________________<BR>erlang-questions
mailing list<BR><A href="mailto:erlang-questions@erlang.org"
target=_blank>erlang-questions@erlang.org</A><BR><A
href="http://erlang.org/mailman/listinfo/erlang-questions"
target=_blank>http://erlang.org/mailman/listinfo/erlang-questions</A><BR><BR></BLOCKQUOTE></DIV><BR></BODY></HTML>