gossip failed

107 views
Skip to first unread message

bruno darrigues

unread,
May 24, 2012, 11:03:27 AM5/24/12
to Akka User List
Hi guys,

i am playing with a cluster junit test. i start a cluster with 4 nodes
Node0, Node1, Node2, Node3. Each register a MembershipChangeListener,
and after all converged i stop node0 and ... gossip failed to elect a
new leader.

Regards
Bruno

if it may help here is the java code :

import java.util.ArrayList;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.junit.Test;

import scala.actors.remote.Node;
import scala.collection.immutable.SortedSet;

import akka.actor.ActorRef;
import akka.actor.ActorRefFactory;
import akka.actor.ActorSystem;
import akka.actor.Props;

import com.orange.igcakka.actors.ConferenceActor;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;

import akka.actor.*;
import akka.actor.Status.*;
import akka.remote.*;
import akka.routing.*;
import akka.event.Logging.*;
import akka.japi.Option;
import akka.dispatch.Await.*;
import akka.util.*;
import akka.util.duration.*;
import akka.cluster.Cluster;
import akka.cluster.ClusterAction;
import akka.cluster.Gossip;
import akka.cluster.Member;
import akka.cluster.MembershipChangeListener;
import akka.config.ConfigurationException;


public class ClusterLeader {
private static final Logger LOG =
Logger.getLogger(ClusterLeader.class);

@Test
public void testClusterleader() {
BasicConfigurator.configure();
Config config = ConfigFactory.load();

ActorSystem system0 =
ActorSystem.create("Node0",config.getConfig("Node0").withFallback(config));
Cluster node0 = Cluster.get(system0);

node0.registerListener(new MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
System.out.println("MemberChangeListner node 0 " +
currentMemberRing);
}
});


ActorSystem system1 =
ActorSystem.create("Node1",config.getConfig("Node1").withFallback(config));
Cluster node1 = Cluster.get(system1);
node1.registerListener(new MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
System.out.println("MemberChangeListner node 1 " +
currentMemberRing);
}
});
System.out.println("node1 join node 0 : " + node0.remoteAddress());

node1.join(node0.remoteAddress());

ActorSystem system2 =
ActorSystem.create("Node2",config.getConfig("Node2").withFallback(config));

Cluster node2 = Cluster.get(system2);
node2.registerListener(new MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
System.out.println("MemberChangeListner node 2 " +
currentMemberRing);
}
});

node2.join(node1.remoteAddress());

ActorSystem system3 =
ActorSystem.create("Node3",config.getConfig("Node3").withFallback(config));

Cluster node3 = Cluster.get(system3);
node3.registerListener(new MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
System.out.println("MemberChangeListner node 3 " +
currentMemberRing);
}
});

node3.join(node2.remoteAddress());

try {
Thread.sleep(1000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
node0.shutdown();

ArrayList<Cluster> nodes = new ArrayList<Cluster>();
nodes.add(node0);
nodes.add(node1);
nodes.add(node2);
nodes.add(node3);

System.out.println("convergence : " + awaitConvergence(nodes));

System.out.println("members node0 : " + node0.isLeader());
System.out.println("members node1 : " + node1.isLeader());
System.out.println("members node2 : " + node1.isLeader());
System.out.println("members node3 : " + node1.isLeader());

}
public boolean awaitConvergence(ArrayList<Cluster> nodes) {
int time=0;
Boolean converged = false;
while(converged == false ) {
converged = true;
for (Cluster node : nodes) {
if (node.convergence().isDefined() == false) {
converged = false;
}
}
try {
Thread.sleep(1000);
time += 1000;
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//nodes foreach { n => println("Converged: " + n.self + " == " +
n.convergence.isDefined) }
if (time>60000) {
return converged;
}
}
return converged;
}

}


and the application.conf
Node0 {
include "common"
akka {
# Akka version, checked against the runtime version of Akka.
version = "2.1-SNAPSHOT"

# Home directory of Akka, modules in the deploy directory will be
loaded
home = ""

# Event handlers to register at boot time (Logging$DefaultLogger
logs to STDOUT)
event-handlers = ["akka.event.Logging$DefaultLogger"]

# Log level used by the configured loggers (see "event-handlers") as
soon
# as they have been started; before that, see "stdout-loglevel"
# Options: ERROR, WARNING, INFO, DEBUG
loglevel = "INFO"

# Log level for the very basic logger activated during
AkkaApplication startup
# Options: ERROR, WARNING, INFO, DEBUG
stdout-loglevel = "WARNING"

# Log the complete configuration at INFO level when the actor system
is started.
# This is useful when you are uncertain of what configuration is
used.
log-config-on-start = "off"
loglevel = DEBUG
stdout-loglevel = DEBUG
actor {
provider = "akka.remote.RemoteActorRefProvider"

}
remote {
transport = "akka.remote.netty.NettyRemoteTransport"
netty {
hostname = "127.0.0.1"
port = 2552
}
}
cluster {
failure-detector.threshold = 3
auto-down = on
}
}
}

Node1 {
include "common"
akka {
# Akka version, checked against the runtime version of Akka.
version = "2.1-SNAPSHOT"

# Home directory of Akka, modules in the deploy directory will be
loaded
home = ""

# Event handlers to register at boot time (Logging$DefaultLogger
logs to STDOUT)
event-handlers = ["akka.event.Logging$DefaultLogger"]

# Log level used by the configured loggers (see "event-handlers") as
soon
# as they have been started; before that, see "stdout-loglevel"
# Options: ERROR, WARNING, INFO, DEBUG
loglevel = "INFO"

# Log level for the very basic logger activated during
AkkaApplication startup
# Options: ERROR, WARNING, INFO, DEBUG
stdout-loglevel = "WARNING"

# Log the complete configuration at INFO level when the actor system
is started.
# This is useful when you are uncertain of what configuration is
used.
log-config-on-start = off
loglevel = DEBUG
stdout-loglevel = DEBUG

actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
transport = "akka.remote.netty.NettyRemoteTransport"
netty {
hostname = "127.0.0.1"
port = 2553
}
}
cluster {
node-to-join = "akka://Node0@localhost:2552"
}

}
}

Node2 {
include "common"
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
transport = "akka.remote.netty.NettyRemoteTransport"
netty {
hostname = "127.0.0.1"
port = 2554
}
}
cluster {
node-to-join = "akka://Node0@localhost:2552"
}
}
}

Node3 {
include "common"
akka {
actor {
provider = "akka.remote.RemoteActorRefProvider"
}
remote {
transport = "akka.remote.netty.NettyRemoteTransport"
netty {
hostname = "127.0.0.1"
port = 2555
}
}
cluster {
node-to-join = "akka://Node0@localhost:2552"
}
}
}

and the maven dependencies
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor</artifactId>
<version>2.1-20120513-092052</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-remote</artifactId>
<version>2.1-20120513-092052</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-cluster</artifactId>
<version>2.1-20120513-092052</version>
</dependency>


Patrik Nordwall

unread,
May 24, 2012, 11:18:32 AM5/24/12
to akka...@googlegroups.com
Hi Bruno,
Thanks for your interest in the clustering and for reporting.
I will try to reproduce you issue tomorrow, with our new excellent multi node test framework.




--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.




--

Patrik Nordwall
Typesafe The software stack for applications that scale
Twitter: @patriknw


√iktor Ҡlang

unread,
May 24, 2012, 11:23:53 AM5/24/12
to akka...@googlegroups.com
Excellent, thanks Patrik!
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Patrik Nordwall

unread,
May 27, 2012, 4:38:37 AM5/27/12
to akka...@googlegroups.com
Hi again, here is a first version of the multi node LeaderElectionSpec (not in master yet):

It's in Scala, but I hope you see the intention.

As far as I can tell the "election" works fine when shutting down leaders.
Inlined some comments to your issue...

On Thu, May 24, 2012 at 5:23 PM, √iktor Ҡlang <viktor...@gmail.com> wrote:
Excellent, thanks Patrik!


On Thu, May 24, 2012 at 5:18 PM, Patrik Nordwall <patrik....@gmail.com> wrote:
Hi Bruno,
Thanks for your interest in the clustering and for reporting.
I will try to reproduce you issue tomorrow, with our new excellent multi node test framework.


On Thu, May 24, 2012 at 5:03 PM, bruno darrigues <bruno.d...@gmail.com> wrote:
Hi guys,

i am playing with a cluster junit test. i start a cluster with 4 nodes
Node0, Node1, Node2, Node3. Each register a MembershipChangeListener,
and after all converged i stop node0 and ... gossip failed to elect a
new leader.

What do you mean with "gossip failed"?
I think this awaitConvergence might be the cause of confusion. convergence only means that all nodes have seen the same cluster state. It doesn't say anything about what the state is. You should probably check number of members and that their state is Up. Something like this: https://github.com/akka/akka/blob/597271052f9c650ec8c7df5cc8318ccfd0be4018/akka-cluster/src/multi-jvm/scala/akka/cluster/MultiNodeClusterSpec.scala#L56

Cheers, Patrik

bruno darrigues

unread,
May 29, 2012, 8:35:41 AM5/29/12
to Akka User List
hi Patrick

the pb is i saw a loop in my logs due to the node0 get down, (wich i
haven't in the node 0 still up). but i think it is due to my
misunderstood of the api.
it is difficult to see the attention in your test director because the
config files are in different folders so for an old non scala
programmer it is hard lolll.
What i am understand :
in the first jvm i have to launch a node (ie an ActorSystem ?) and
create a Cluster via Cluster socle = Cluster.get(system0).

on the second jvm, wich sequence i have to do to join my new
ActorSystem to the previous node ? Using the Node class ?

Is the node-to-join in the application.conf is already take into
account or may i have to define it in the config parse string for Node
1 ?

What i want to prototype with akka cluster is a business load
balancing based on consistent hash map. i think there is already all i
need for this.

In a first step each a new node just have to know his rignt and left
neigbourghs (via gossip members ?).

Howver as it is the leader who set the new node to the up state, is it
possible to define an intermediate "business" state like node=READY
before the state UP. My need is , when a node is joinning the ring
cluster, the already actives nodes , take into account the new one and
could tell him somethnig like "welcome guy, i manage some business
actor which you ll have to manage now", And only when the new node has
finished to migrate them could say to leader, "ok my ready now" and
the leader set him UP.

Thanks for our advices

regards
Bruno

ps: here is an extract logs of the loop i have when the node0 shutdown

[DEBUG] [05/29/2012 13:36:52.438] [Node1-akka.actor.default-
dispatcher-4] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Initiating new round of gossip
[DEBUG] [05/29/2012 13:36:52.438] [Node1-akka.actor.default-
dispatcher-4] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Gossiping to [Actor[akka://
No...@127.0.0.1:2552/system/cluster/gossip]]
[DEBUG] [05/29/2012 13:36:52.438] [Node1-akka.actor.default-
dispatcher-1] [FailureDetector(akka://Node1)] Node [akka://
No...@127.0.0.1:2553] - Phi value [0.24220971534364338] and threshold
[8] for connection [akka://No...@127.0.0.1:2554]
[DEBUG] [05/29/2012 13:36:52.438] [Node1-akka.actor.default-
dispatcher-1] [FailureDetector(akka://Node1)] Node [akka://
No...@127.0.0.1:2553] - Phi value [0.716015245406191] and threshold
[8] for connection [akka://No...@127.0.0.1:2555]
[DEBUG] [05/29/2012 13:36:52.454] [Node1-akka.actor.default-
dispatcher-4] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Gossiping to [Actor[akka://
No...@127.0.0.1:2555/system/cluster/gossip]]
[DEBUG] [05/29/2012 13:36:52.454] [Node0-4]
[LocalActorRefProvider(akka://Node0)] look-up of path sequence [/
system/cluster/gossip] failed
[DEBUG] [05/29/2012 13:36:52.610] [Node1-akka.actor.default-
dispatcher-1] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Receiving gossip from [akka://
No...@127.0.0.1:2554]
[DEBUG] [05/29/2012 13:36:52.610] [Node1-akka.actor.default-
dispatcher-1] [FailureDetector(akka://Node1)] Node [akka://
No...@127.0.0.1:2553] - Heartbeat from connection [akka://
No...@127.0.0.1:2554]
[DEBUG] [05/29/2012 13:36:52.657] [Node0-2]
[LocalActorRefProvider(akka://Node0)] look-up of path sequence [/
system/cluster/gossip] failed
[DEBUG] [05/29/2012 13:36:53.219] [main] [Node(akka://Node0)] Cluster
Node [akka://No...@127.0.0.1:2552] - Cluster convergence reached
[DEBUG] [05/29/2012 13:36:53.547] [Node1-akka.actor.default-
dispatcher-4] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Initiating new round of gossip
[DEBUG] [05/29/2012 13:36:53.547] [Node1-akka.actor.default-
dispatcher-1] [FailureDetector(akka://Node1)] Node [akka://
No...@127.0.0.1:2553] - Phi value [0.11440179927628406] and threshold
[8] for connection [akka://No...@127.0.0.1:2554]
[DEBUG] [05/29/2012 13:36:53.547] [Node1-akka.actor.default-
dispatcher-4] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Gossiping to [Actor[akka://
No...@127.0.0.1:2552/system/cluster/gossip]]
[DEBUG] [05/29/2012 13:36:53.547] [Node1-akka.actor.default-
dispatcher-1] [FailureDetector(akka://Node1)] Node [akka://
No...@127.0.0.1:2553] - Phi value [0.9063462394511254] and threshold
[8] for connection [akka://No...@127.0.0.1:2555]
[DEBUG] [05/29/2012 13:36:53.547] [Node0-5]
[LocalActorRefProvider(akka://Node0)] look-up of path sequence [/
system/cluster/gossip] failed
[DEBUG] [05/29/2012 13:36:53.704] [Node1-akka.actor.default-
dispatcher-2] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Receiving gossip from [akka://
No...@127.0.0.1:2554]
[DEBUG] [05/29/2012 13:36:53.704] [Node1-akka.actor.default-
dispatcher-2] [FailureDetector(akka://Node1)] Node [akka://
No...@127.0.0.1:2553] - Heartbeat from connection [akka://
No...@127.0.0.1:2554]
[DEBUG] [05/29/2012 13:36:53.766] [Node1-akka.actor.default-
dispatcher-1] [Node(akka://Node1)] Cluster Node [akka://
No...@127.0.0.1:2553] - Receiving gossip from [akka://
No...@127.0.0.1:2555]
[DEBUG] [05/29/2012 13:36:53.766] [Node1-akka.actor.default-
dispatcher-1] [FailureDetector(akka://Node1)] Node [akka://
No...@127.0.0.1:2553] - Heartbeat from connection [akka://
No...@127.0.0.1:2555]
convergence : false
members node0 : true
members node1 : false
members node2 : false
members node3 : false


On 27 mai, 10:38, Patrik Nordwall <patrik.nordw...@gmail.com> wrote:
> Hi again, here is a first version of the multi node LeaderElectionSpec (not
> in master yet):https://github.com/akka/akka/blob/597271052f9c650ec8c7df5cc8318ccfd0b...
>
> It's in Scala, but I hope you see the intention.
>
> As far as I can tell the "election" works fine when shutting down leaders.
> Inlined some comments to your issue...
>
> members and that their state is Up. Something like this:https://github.com/akka/akka/blob/597271052f9c650ec8c7df5cc8318ccfd0b...
> >>>                event-handlers =...
>
> plus de détails »

bruno darrigues

unread,
May 29, 2012, 11:48:26 AM5/29/12
to Akka User List
Helle again Patrick,

is this sequnece of clustering init look right (in java in multi jvm
simultation )?

BasicConfigurator.configure();
Config config = ConfigFactory.load();

ActorSystem system0 =
ActorSystem.create("Node0",config.getConfig("Node0").withFallback(config));
Cluster socleNode0system0 = Cluster.get(system0);

Address socleNode0 = new Address("akka", "Node0", "127.0.0.1",
2552);

socleNode0system0.registerListener(new
MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
LOG.info("MemberChangeListner node 0 " + currentMemberRing);
}
});

socleNode0.join(socleNode0); // if i didn t declare this line
registerListner didn t init

// like in a new jvm

ActorSystem system1 =
ActorSystem.create("Node1",config.getConfig("Node1").withFallback(config));
Cluster socleNode1 = Cluster.get(system1);
socleNode1.registerListener(new MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
System.out.println("MemberChangeListner node 1 " +
currentMemberRing);
}
});
socleNode1.join(socleNode0);
// next jvm
ActorSystem system2 =
ActorSystem.create("Node2",config.getConfig("Node2").withFallback(config));
Cluster socleNode2 = Cluster.get(system2);
socleNode2.registerListener(new MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
System.out.println("MemberChangeListner node 2 " +
currentMemberRing);
}
});
socleNode2.join(socleNode0);


:: THIS TIMER IS IMPORTANT for waiting the convergence

try {
Thread.sleep(10000);

} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}


next step is to remote ActorFor for business process based on
consistent hashp map ;-)...

Regards
Bruno
> > >>>                node2.registerListener(new...
>
> plus de détails »

Patrik Nordwall

unread,
May 30, 2012, 2:50:30 AM5/30/12
to akka...@googlegroups.com
On Tue, May 29, 2012 at 2:35 PM, bruno darrigues <bruno.d...@gmail.com> wrote:
hi Patrick

the pb is i saw a loop in my logs due to the node0 get down, (wich i
haven't in the node 0 still up). but i think it is due to my
misunderstood of the api.
it is difficult to see the attention in your test director because the
config files are in different folders so for an old  non scala
programmer it is hard lolll.
What i am understand :
in the first jvm i have to launch a node (ie an ActorSystem ?) and
create a Cluster via Cluster socle = Cluster.get(system0).

yes, that is correct
Here is a bunch of more cluster tests that you can take a look at: https://github.com/akka/akka/tree/master/akka-cluster/src/multi-jvm/scala/akka/cluster


on the second jvm, wich sequence i have to do to join my new
ActorSystem to the previous node ? Using the Node class ?

For testing it is convenient to do the join programmatically, but that can also be done with configuration  
cluster.join(addressToJoin);

Is the node-to-join in the application.conf is already take into
account or may i have to define it in the config parse string for Node
1 ?

You can skip node-to-join in config, if you do the join programmatically. 
For a real cluster you want to configure it with the seed nodes (see cluster specification)

What i want to prototype with akka cluster is a business load
balancing based on consistent hash map. i think there is already all i
need for this.

In a first step each a new node just have to know his rignt and left
neigbourghs (via gossip members ?).

Howver as it is the leader who set the new node to the up state, is it
possible to define an intermediate "business" state like node=READY
before the state UP. My need is , when a node is joinning the ring
cluster, the already actives nodes , take into account the new one and
could tell him somethnig like "welcome guy, i manage some business
actor which you ll have to manage now", And only when the new node has
finished to migrate them could say to leader, "ok my ready now" and
the leader set him UP.

Cluster functionality for actors is not implemented yet, but it will of course be a core feature of akka cluster.

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Patrik Nordwall

unread,
May 30, 2012, 2:56:21 AM5/30/12
to akka...@googlegroups.com
On Tue, May 29, 2012 at 5:48 PM, bruno darrigues <bruno.d...@gmail.com> wrote:
Helle again Patrick,

is this sequnece of clustering init look right (in java in multi jvm
simultation )?

       BasicConfigurator.configure();
       Config config = ConfigFactory.load();

       ActorSystem system0 =
ActorSystem.create("Node0",config.getConfig("Node0").withFallback(config));
       Cluster socleNode0system0 = Cluster.get(system0);

       Address socleNode0 = new Address("akka", "Node0", "127.0.0.1",
2552);

       socleNode0system0.registerListener(new
MembershipChangeListener(){
         public void notify(SortedSet<Member> currentMemberRing) {
               LOG.info("MemberChangeListner node 0 " + currentMemberRing);
         }
       });

       socleNode0.join(socleNode0); // if i didn t declare this line
registerListner didn t init

ok, that's strange, I will investigate
yes, it looks correct
 
next step is to remote ActorFor for business process based on
consistent hashp map ;-)...

Happy hAkking
 
>
> plus de détails »

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Patrik Nordwall

unread,
May 31, 2012, 5:49:11 AM5/31/12
to akka...@googlegroups.com
On Wed, May 30, 2012 at 8:56 AM, Patrik Nordwall <patrik....@gmail.com> wrote:


On Tue, May 29, 2012 at 5:48 PM, bruno darrigues <bruno.d...@gmail.com> wrote:
Helle again Patrick,

is this sequnece of clustering init look right (in java in multi jvm
simultation )?

       BasicConfigurator.configure();
       Config config = ConfigFactory.load();

       ActorSystem system0 =
ActorSystem.create("Node0",config.getConfig("Node0").withFallback(config));
       Cluster socleNode0system0 = Cluster.get(system0);

       Address socleNode0 = new Address("akka", "Node0", "127.0.0.1",
2552);

       socleNode0system0.registerListener(new
MembershipChangeListener(){
         public void notify(SortedSet<Member> currentMemberRing) {
               LOG.info("MemberChangeListner node 0 " + currentMemberRing);
         }
       });

       socleNode0.join(socleNode0); // if i didn t declare this line
registerListner didn t init

ok, that's strange, I will investigate

I tried to reproduce this, but can't find any problem. Looking at the implementation I see no reason why it would be needed. 

Note that this doesn't compile:
socleNode0.join(socleNode0);

I assume you used:
socleNode0system0.join(socleNode0);

Anyway, thanks for reporting.

bruno darrigues

unread,
May 31, 2012, 4:46:01 PM5/31/12
to Akka User List
Hi Patrick,

it is ok now, at startup, i create the ActorSystem for the vm and
create a local ActorRef for my factory.

In each local factory preStart() i register a listner to listen all
cluster s nodes event via Gossiping.

I notice that if i only mention a node-To-join in the
application.conf, the Member is not notified, i have to explicit the
join method to do it

here is the preStart() wich works like a charm loll)
public void preStart() {
LOG.info("factory preStarting ... " );
Cluster socleSystem = Cluster.get(getContext().system());
try {
Thread.sleep(2000);

} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

socleSystem.registerListener( new MembershipChangeListener(){
public void notify(SortedSet<Member> currentMemberRing) {
LOG.info("registerListener MemberChangeListner " +
currentMemberRing);
factoryNotify(currentMemberRing);
}
});

Address socleNode = new Address("akka", "Socle", "127.0.0.1",
2552); // this node will be passed in arg at constructor arguments)
socleSystem.join(socleNode);
}


my next step will be a litlle more tricky and i want to have your
advice. When a new node is joigning or leave, my leader to recalculate
a stragegy plan, send it to existing nodes and only when existing
nodes are synchronize with the new one, the leader set the incoing
node to up.

is there a way to overwrite the gossip methode to set node to up ? is
there a leader listner method ? may i have to develop a custom
protocol to synchronize up nodes ?

sorry i am not clear.

And thx for your awersome work.

Regards
Bruno
ps: i you are interested, all my business messages are generated by
maven and xjc jaxb plugin with serializable bindings. if it may help



On 31 mai, 11:49, Patrik Nordwall <patrik.nordw...@gmail.com> wrote:
> On Wed, May 30, 2012 at 8:56 AM, Patrik Nordwall
> <patrik.nordw...@gmail.com>wrote:
> >> > > > On Thu, May 24,...
>
> plus de détails »

Patrik Nordwall

unread,
Jun 1, 2012, 9:38:55 AM6/1/12
to akka...@googlegroups.com
Great!


my next step will be a litlle more tricky and i want to have your
advice. When a new node is joigning or leave, my leader to recalculate
a stragegy plan, send it to existing nodes and only when existing
nodes are synchronize with the new one, the leader set the incoing
node to up.

is there a way to overwrite the gossip methode to set node to up ?

You mean like having another state in-between Joining and Up? Right now that is not supported and I don't know if that is something we will do. Isn't that some kind of application specific synchronization? 
Are there any other akka cluster developer that has an opinion?
 
is
there a leader listner method ?

You mean like the MembershipChangeListener? No, but there is cluster.isLeader.
 
may i have  to develop a custom
protocol to synchronize up nodes ?

I think so. Perhaps the MetaData can be used, but I'm not sure. http://www.assembla.com/spaces/akka/tickets/1913
>
> plus de détails »

--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Jonas Bonér

unread,
Jun 1, 2012, 10:14:22 AM6/1/12
to akka...@googlegroups.com
On Fri, Jun 1, 2012 at 3:38 PM, Patrik Nordwall
<patrik....@gmail.com> wrote:
>>
>> my next step will be a litlle more tricky and i want to have your
>> advice. When a new node is joigning or leave, my leader to recalculate
>> a stragegy plan, send it to existing nodes and only when existing
>> nodes are synchronize with the new one, the leader set the incoing
>> node to up.
>>
>> is there a way to overwrite the gossip methode to set node to up ?
>
>
> You mean like having another state in-between Joining and Up? Right now that
> is not supported and I don't know if that is something we will do. Isn't
> that some kind of application specific synchronization?
> Are there any other akka cluster developer that has an opinion?

Don't think we want to do that. You can currently listen in to all the
life-cycle events, and add your custom action to it.

>
>>
>> is
>> there a leader listner method ?
>
>
> You mean like the MembershipChangeListener? No, but there is
> cluster.isLeader.

And the leader is always the first Member in cluster.latestGossip.members.

>
>>
>> may i have  to develop a custom
>> protocol to synchronize up nodes ?
>
>
> I think so. Perhaps the MetaData can be used, but I'm not
> sure. http://www.assembla.com/spaces/akka/tickets/1913



--
Jonas Bonér
CTO
Typesafe - The software stack for applications that scale
Phone: +46 733 777 123
Twitter: @jboner
Reply all
Reply to author
Forward
0 new messages