[erlang-questions] unregistering a process during takeover

Ulf Wiger ulf@REDACTED
Fri Jan 23 22:30:06 CET 2015


My comment about the boot script was just because I didn’t see a -boot option in your command line.

When did you run application:info() on b and saw the application running there? Was it after killing a?

To be clear, your config says the application should failover to *either* b or c.

BR,
Ulf W


> On 23 Jan 2015, at 20:58, Nuku Ameyibor <nayibor@REDACTED> wrote:
> 
> 
> 
> Dear ulf ,
> 
> I used retool.config to create the release.   i run the executables  created to run the application and added -c option for da various nodes . 
> I did start the executables on node b cuz i had sync_nodes_mandatory option and a restart/run of app on node a  requires  node  b and c to be running . 
> I also run application:info() on b and saw the application running on b 
> It was however not running on node c due to the takeover .
> Had to create a new shell on node c . 
> 
> Anyway i will try again and  note u suggestions  about rebar ,relx ,setup .
> Thanks a lot !!!
> From: Ulf Wiger <mailto:ulf@REDACTED>
> Sent: ‎23/‎01/‎2015 17:49
> To: Nuku Ameyibor <mailto:nayibor@REDACTED>
> Cc: erlang questions <mailto:erlang-questions@REDACTED>
> Subject: Re: [erlang-questions] unregistering a process during takeover
> 
> Not sure based on what you’ve described. A possibility is that you’ve forgotten to start the application on b.
> 
> The next step, though, would be to also use a boot script. You could use rebar, relx, OTP systools or my personal pet project, setup [1].
> 
> Using a boot script, your applications are started automatically, or in the case of distributed apps, at least prepared to start, so that failover/takeover can work.
> 
> BR,
> Ulf W
> 
> [1] http://github.com/uwiger/setup <http://github.com/uwiger/setup>
>     https://github.com/uwiger/setup/wiki/Example%3A-generating-boot-scripts-from-a-running-system <https://github.com/uwiger/setup/wiki/Example:-generating-boot-scripts-from-a-running-system>
> 
> 
>> On 23 Jan 2015, at 12:09, Nuku Ameyibor <nayibor@REDACTED <mailto:nayibor@REDACTED>> wrote:
>> 
>> hi ulf ,
>> thanks.
>> the takeover is working okay now  !!! .
>> config a is this 
>> 
>> [{kernel,
>>   [{distributed, [{m8ball,
>>                    5000,
>>                   [a@REDACTED, {b@REDACTED, c@REDACTED}]}]},
>>    {sync_nodes_mandatory, [b@REDACTED, c@REDACTED]},
>>    {sync_nodes_timeout, 30000}
>>   ]
>>  }
>> ].
>> 
>> i start each node with  
>> bin\werl.exe -sname c -config C:\wamp\www\erlang\proj\m8ball\apps\m8ball_1_0_0\config\c.config
>> 
>> there are 3 nodes .their conf files are similar with sync_nodes_mandatory being slightly different .
>> 
>> a small question .
>> the first round of  failover and takeover seems to work fine .
>> but after the first round (start node a,b,c  . kill a  b does failover .kill b c does failover . restart a,b  a does takeover from c killing c application on c .i restart shell on c  )
>> 
>>  after the first round when  i try to do a failover   onto b by killing a it doesnt work .
>> was wondering how come since the first round of failover take over worked fine .
>> 
>> 
>> 
>> 
>> On Fri, Jan 23, 2015 at 6:35 AM, Ulf Wiger <ulf@REDACTED <mailto:ulf@REDACTED>> wrote:
>> 
>>> On 23 Jan 2015, at 03:44, Nuku Ameyibor <nayibor@REDACTED <mailto:nayibor@REDACTED>> wrote:
>>> 
>>> =INFO REPORT==== 23-Jan-2015::02:20:57 ===
>>> global: Name conflict terminating {m8ball_server,<2910.62.0>}
>> 
>> This suggests that you’re connecting the nodes *after* starting your applications, so that the application processes have time to globally register themselves first. Global detects the name conflict when trying to merge the registries of the two nodes.
>> 
>> You can for example use the ‘distributed’ option, described here:
>> http://www.erlang.org/doc/apps/kernel/application.html#load-1 <http://www.erlang.org/doc/apps/kernel/application.html#load-1>
>> 
>> and here:
>> 
>> http://www.erlang.org/doc/man/kernel_app.html <http://www.erlang.org/doc/man/kernel_app.html>
>> 
>> BR,
>> Ulf W
>> 
>> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
>> http://feuerlabs.com <http://feuerlabs.com/>
>> 
>> 
>> 
>> 
> 
> Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
> http://feuerlabs.com <http://feuerlabs.com/>
> 
> 
> 

Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc.
http://feuerlabs.com



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150123/4b08455d/attachment.htm>


More information about the erlang-questions mailing list