i attach the files and i run , it display like this
//========================== MAIN PROGRAM OF CLUSTER STARTED
===================================
//========================== CREATE ACTOR
===================================
[DEBUG] [07/20/2017 19:41:07.463] [main]
[EventStream(akka://ClusterSystem)] logger log1-Logging$DefaultLogger
started
[DEBUG] [07/20/2017 19:41:07.463] [main]
[EventStream(akka://ClusterSystem)] Default Loggers started
[INFO] [07/20/2017 19:41:08.476] [main] [akka.remote.Remoting] Starting
remoting
[INFO] [07/20/2017 19:41:09.613] [main] [akka.remote.Remoting] Remoting
started; listening on addresses :[akka.tcp://[email protected]:1170]
[INFO] [07/20/2017 19:41:09.613] [main] [akka.remote.Remoting] Remoting now
listens on addresses: [akka.tcp://[email protected]:1170]
[INFO] [07/20/2017 19:41:09.676] [main]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:1170] - Starting up...
[INFO] [07/20/2017 19:41:10.237] [main]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:1170] - Registered cluster JMX MBean
[akka:type=Cluster]
[INFO] [07/20/2017 19:41:10.237] [main]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:1170] - Started up successfully
//============================ CREATE ACTOR REF
=================================
//========================= CLUSTER SUBSCRIBE
====================================
//============================= END OF MAIN ================================
//======================== CLUSTER INVOKING PRESTART METHOD
==================================
//======================== CLUSTER PRESTART METHOD INVOKED
==================================
[DEBUG] [07/20/2017 19:41:10.502]
[ClusterSystem-akka.actor.default-dispatcher-4]
[akka.tcp://[email protected]:1170/system/cluster-metrics] Collection
started.
[WARN] [07/20/2017 19:41:10.533]
[ClusterSystem-akka.actor.default-dispatcher-4]
[akka.tcp://[email protected]:1170/system/cluster/core/daemon/downingProvider]
Don't use auto-down feature of Akka Cluster in production. See
'Auto-downing (DO NOT USE)' section of Akka Cluster documentation.
[DEBUG] [07/20/2017 19:41:10.580]
[ClusterSystem-akka.actor.default-dispatcher-17]
[akka.cluster.metrics.MetricsCollector$(akka://ClusterSystem)] Trying
akka.cluster.metrics.SigarMetricsCollector.
[DEBUG] [07/20/2017 19:41:10.611]
[ClusterSystem-akka.actor.default-dispatcher-17]
[akka.cluster.metrics.MetricsCollector$(akka://ClusterSystem)] Trying
akka.cluster.metrics.JmxMetricsCollector.
[INFO] [07/20/2017 19:41:10.642]
[ClusterSystem-akka.actor.default-dispatcher-17]
[akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node
[akka.tcp://[email protected]:1170] - Metrics collection has started
successfully
[DEBUG] [07/20/2017 19:41:11.935]
[ClusterSystem-akka.remote.default-remote-dispatcher-8]
[akka.tcp://[email protected]:1170/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter]
AssociationError [akka.tcp://[email protected]:1170] ->
[akka.tcp://[email protected]:2552]: Error [Association failed with
[akka.tcp://[email protected]:2552]] [
akka.remote.EndpointAssociationException: Association failed with
[akka.tcp://[email protected]:2552]
Caused by: akka.remote.transport.netty.NettyTransportExceptionNoStack:
Connection refused: no further information: /127.0.0.1:2552
]
[WARN] [07/20/2017 19:41:11.935]
[ClusterSystem-akka.remote.default-remote-dispatcher-7]
[akka.tcp://[email protected]:1170/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0]
Association with remote system [akka.tcp://[email protected]:2552]
has failed, address is now gated for [5000] ms. Reason: [Association failed
with [akka.tcp://[email protected]:2552]] Caused by: [Connection
refused: no further information: /127.0.0.1:2552]
[WARN] [07/20/2017 19:41:12.060] [New I/O boss #3]
[NettyTransport(akka://ClusterSystem)] Remote connection to null failed
with java.net.ConnectException: Connection refused: no further information:
/127.0.0.1:2552
[WARN] [07/20/2017 19:41:12.060] [New I/O boss #3]
[NettyTransport(akka://ClusterSystem)] Remote connection to null failed
with java.net.ConnectException: Connection refused: no further information:
/127.0.0.1:2551
[DEBUG] [07/20/2017 19:41:12.060]
[ClusterSystem-akka.remote.default-remote-dispatcher-8]
[akka.tcp://[email protected]:1170/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-1/endpointWriter]
AssociationError [akka.tcp://[email protected]:1170] ->
[akka.tcp://[email protected]:2551]: Error [Association failed with
[akka.tcp://[email protected]:2551]] [
akka.remote.EndpointAssociationException: Association failed with
[akka.tcp://[email protected]:2551]
Caused by: akka.remote.transport.netty.NettyTransportExceptionNoStack:
Connection refused: no further information: /127.0.0.1:2551
]
[WARN] [07/20/2017 19:41:12.060]
[ClusterSystem-akka.remote.default-remote-dispatcher-8]
[akka.tcp://[email protected]:1170/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-1]
Association with remote system [akka.tcp://[email protected]:2551]
has failed, address is now gated for [5000] ms. Reason: [Association failed
with [akka.tcp://[email protected]:2551]] Caused by: [Connection
refused: no further information: /127.0.0.1:2551]
[DEBUG] [07/20/2017 19:41:12.154]
[ClusterSystem-akka.remote.default-remote-dispatcher-7]
[akka.tcp://[email protected]:1170/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-1/endpointWriter]
Disassociated [akka.tcp://[email protected]:1170] ->
[akka.tcp://[email protected]:2551]
[INFO] [07/20/2017 19:41:12.154]
[ClusterSystem-akka.actor.default-dispatcher-16]
[akka://ClusterSystem/deadLetters] Message
[akka.cluster.InternalClusterAction$InitJoin$] from
Actor[akka://ClusterSystem/system/cluster/core/daemon/joinSeedNodeProcess-1#1158725741]
to Actor[akka://ClusterSystem/deadLetters] was not delivered. [1] dead
letters encountered. This logging can be turned off or adjusted with
configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
[DEBUG] [07/20/2017 19:41:12.154]
[ClusterSystem-akka.remote.default-remote-dispatcher-8]
[akka.tcp://[email protected]:1170/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter]
Disassociated [akka.tcp://[email protected]:1170] ->
[akka.tcp://[email protected]:2552]
[INFO] [07/20/2017 19:41:12.169]
[ClusterSystem-akka.actor.default-dispatcher-16]
[akka.tcp://[email protected]:2552/user/clusterListener] Message
[java.lang.String] from Actor[akka://ClusterSystem/temp/$a] to
Actor[akka.tcp://[email protected]:2552/user/clusterListener] was not
delivered. [2] dead letters encountered. This logging can be turned off or
adjusted with configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
[INFO] [07/20/2017 19:41:12.169]
[ClusterSystem-akka.actor.default-dispatcher-16]
[akka://ClusterSystem/deadLetters] Message
[akka.cluster.InternalClusterAction$InitJoin$] from
Actor[akka://ClusterSystem/system/cluster/core/daemon/joinSeedNodeProcess-1#1158725741]
to Actor[akka://ClusterSystem/deadLetters] was not delivered. [3] dead
letters encountered. This logging can be turned off or adjusted with
configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
[INFO] [07/20/2017 19:41:12.185]
[ClusterSystem-akka.actor.default-dispatcher-18]
[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-1/endpointWriter]
Message [akka.remote.EndpointWriter$AckIdleCheckTimer$] from
Actor[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-1/endpointWriter#-2146084698]
to
Actor[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2551-1/endpointWriter#-2146084698]
was not delivered. [4] dead letters encountered. This logging can be turned
off or adjusted with configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
[INFO] [07/20/2017 19:41:12.185]
[ClusterSystem-akka.actor.default-dispatcher-18]
[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter]
Message [akka.remote.EndpointWriter$AckIdleCheckTimer$] from
Actor[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter#2095159069]
to
Actor[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter#2095159069]
was not delivered. [5] dead letters encountered. This logging can be turned
off or adjusted with configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
[INFO] [07/20/2017 19:41:12.185]
[ClusterSystem-akka.actor.default-dispatcher-18]
[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter]
Message [akka.remote.EndpointWriter$AckIdleCheckTimer$] from
Actor[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter#2095159069]
to
Actor[akka://ClusterSystem/system/endpointManager/reliableEndpointWriter-akka.tcp%3A%2F%2FClusterSystem%40127.0.0.1%3A2552-0/endpointWriter#2095159069]
was not delivered. [6] dead letters encountered. This logging can be turned
off or adjusted with configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
//========================== CLUSTER IS STOPPED ....!
================================
[ERROR] [07/20/2017 19:41:15.504]
[ClusterSystem-akka.actor.default-dispatcher-3]
[akka://ClusterSystem/user/SimpleClusterListner] Ask timed out on
[Actor[akka.tcp://[email protected]:2552/user/clusterListener]] after
[5000 ms]. Sender[null] sent message of type "java.lang.String".
akka.pattern.AskTimeoutException: Ask timed out on
[Actor[akka.tcp://[email protected]:2552/user/clusterListener]] after
[5000 ms]. Sender[null] sent message of type "java.lang.String".
at
akka.pattern.PromiseActorRef$$anonfun$1.apply$mcV$sp(AskSupport.scala:601)
at akka.actor.Scheduler$$anon$4.run(Scheduler.scala:140)
at
scala.concurrent.Future$InternalCallbackExecutor$.unbatchedExecute(Future.scala:601)
at
scala.concurrent.BatchingExecutor$class.execute(BatchingExecutor.scala:109)
at
scala.concurrent.Future$InternalCallbackExecutor$.execute(Future.scala:599)
at
akka.actor.LightArrayRevolverScheduler$TaskHolder.executeTask(LightArrayRevolverScheduler.scala:328)
at
akka.actor.LightArrayRevolverScheduler$$anon$4.executeBucket$1(LightArrayRevolverScheduler.scala:279)
at
akka.actor.LightArrayRevolverScheduler$$anon$4.nextTick(LightArrayRevolverScheduler.scala:283)
at
akka.actor.LightArrayRevolverScheduler$$anon$4.run(LightArrayRevolverScheduler.scala:235)
at java.lang.Thread.run(Thread.java:745)
//======================== CLUSTER INVOKING PRESTART METHOD
==================================
//======================== CLUSTER PRESTART METHOD INVOKED
==================================
[INFO] [07/20/2017 19:41:15.520]
[ClusterSystem-akka.actor.default-dispatcher-5]
[akka.tcp://[email protected]:2552/user/clusterListener] Message
[java.lang.String] from Actor[akka://ClusterSystem/temp/$b] to
Actor[akka.tcp://[email protected]:2552/user/clusterListener] was not
delivered. [7] dead letters encountered. This logging can be turned off or
adjusted with configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
[INFO] [07/20/2017 19:41:15.551]
[ClusterSystem-akka.actor.default-dispatcher-5]
[akka://ClusterSystem/deadLetters] Message
[akka.cluster.InternalClusterAction$InitJoin$] from
Actor[akka://ClusterSystem/system/cluster/core/daemon/joinSeedNodeProcess-1#1158725741]
to Actor[akka://ClusterSystem/deadLetters] was not delivered. [8] dead
letters encountered. This logging can be turned off or adjusted with
configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
[INFO] [07/20/2017 19:41:15.551]
[ClusterSystem-akka.actor.default-dispatcher-5]
[akka://ClusterSystem/deadLetters] Message
[akka.cluster.InternalClusterAction$InitJoin$] from
Actor[akka://ClusterSystem/system/cluster/core/daemon/joinSeedNodeProcess-1#1158725741]
to Actor[akka://ClusterSystem/deadLetters] was not delivered. [9] dead
letters encountered. This logging can be turned off or adjusted with
configuration settings 'akka.log-dead-letters' and
'akka.log-dead-letters-during-shutdown'.
can anyone help to solve this error.
--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ:
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.
package com.sample.Cluster;
import akka.actor.ActorRef;
import akka.actor.UntypedActor;
import akka.cluster.Cluster;
import akka.cluster.ClusterEvent;
import akka.cluster.ClusterEvent.ClusterDomainEvent;
import akka.cluster.ClusterEvent.CurrentClusterState;
import akka.cluster.ClusterEvent.MemberEvent;
import akka.cluster.ClusterEvent.MemberJoined;
import akka.cluster.ClusterEvent.MemberUp;
import akka.cluster.ClusterEvent.UnreachableMember;
import akka.event.Logging;
import akka.event.LoggingAdapter;
import akka.pattern.Patterns;
import akka.util.Timeout;
import scala.concurrent.Await;
import scala.concurrent.Future;
import scala.concurrent.duration.Duration;
@SuppressWarnings("deprecation")
public class SimpleClusterListener extends UntypedActor {
Timeout timeout = new Timeout(Duration.create(5, "seconds"));
ActorRef remoteActor;
LoggingAdapter log = Logging.getLogger(getContext().system(), this);
Cluster cluster = Cluster.get(getContext().system());
public static enum Msg {
GREET, DONE;
}
@Override
public void preStart() throws Exception{
System.out.println("//======================== CLUSTER INVOKING PRESTART METHOD ==================================");
cluster.subscribe(self(),ClusterEvent.initialStateAsEvents(),
MemberEvent.class,UnreachableMember.class);
remoteActor = getContext().actorFor("akka.tcp://[email protected]:2552/user/clusterListener");
System.out.println("//======================== CLUSTER PRESTART METHOD INVOKED ==================================");
}
@Override
public void onReceive(Object message) throws Exception {
Future<Object> future = Patterns.ask(remoteActor, message.toString(),timeout);
String result = (String) Await.result(future, timeout.duration());
log.info("Message received from Server -> {}", result);
System.out.println("//======================= MESSAGE ================================");
System.out.println("\n"+result);
System.out.println("//======================== CLUSTER INVOKING ONRECEIVE METHOD ==================================");
if (message instanceof CurrentClusterState) {
System.out.println("//======================== CLUSTER INVOKING CURRENT CLUSTER STATE ==================================");
CurrentClusterState state = (CurrentClusterState) message;
log.info("Current members: {}", state.members());
System.out.println("//======================== CLUSTER INVOKED =================================="+state + state.members());
}
else if (message instanceof MemberJoined) {
System.out.println("//======================== CLUSTER MEMBER IS JOINING ==================================");
MemberJoined mJoined = (MemberJoined) message;
log.info("Member joined: {}", mJoined);
System.out.println("//======================== CLUSTER MEMBER JOINED =================================="+mJoined);
}
else if (message instanceof MemberUp) {
System.out.println("//======================== CLUSTER MEMBER IS UP ==================================");
MemberUp mUp = (MemberUp) message;
log.info("Member is Up: {}", mUp.member());
System.out.println("//======================== CLUSTER MEMBER UP =================================="+mUp+mUp.member());
}
else if (message instanceof UnreachableMember) {
System.out.println("//======================== CLUSTER UNREACHABLE MEMBER ==================================");
UnreachableMember mUnreachable = (UnreachableMember) message;
log.info("Member detected as unreachable: {}", mUnreachable.member());
System.out.println("//======================== CLUSTER MEMBER IS UNREACHABLE =================================="+mUnreachable+mUnreachable.member());
}
else if (message instanceof ClusterDomainEvent) {
// ignore
System.out.println("//======================== CLUSTER IGNORE ==================================");
}
else {
unhandled(message);// if message contain error it goes to unhandled error
System.out.println("//======================== CLUSTER UNHANDLED MESSAGE =================================="+message);
}
}
@Override
public void postStop() throws Exception{
cluster.unsubscribe(self());
System.out.println("//========================== CLUSTER IS STOPPED ....! ================================");
}
}
package com.sample.Cluster;
import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.cluster.Cluster;
import akka.cluster.ClusterEvent.ClusterDomainEvent;
public class SimpleClusterApp extends SimpleClusterListener{
public static void main(String[] args) {
System.out.println("//========================== MAIN PROGRAM OF CLUSTER STARTED ===================================");
final String hostname = args.length > 0 ? args[0] : "127.0.0.1";
final String port = args.length > 1 ? args[1] : "0";
final Config config = ConfigFactory.parseString("akka.remote.netty.tcp.hostname=" + hostname).
withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.port=" + port)).
withFallback(ConfigFactory.load());
System.out.println("//========================== CREATE ACTOR ===================================");
ActorSystem system = ActorSystem.create("ClusterSystem",config);
System.out.println("//============================ CREATE ACTOR REF =================================");
ActorRef clusterListener = system.actorOf(Props.create(SimpleClusterListener.class), "SimpleClusterListner");
clusterListener.tell("hello......First_Cluster_Program", clusterListener);
System.out.println("//========================= CLUSTER SUBSCRIBE ====================================");
Cluster.get(system).subscribe(clusterListener,ClusterDomainEvent.class);
System.out.println("//============================= END OF MAIN ================================");
}
}
akka {
loglevel = "DEBUG"
actor {
provider = "akka.cluster.ClusterActorRefProvider"
}
remote {
transports = ["akka.remote.netty.tcp"]
log-remote-lifecycle-events = on
akka.remote.retry-gate-closed-for = 5 s
netty.tcp {
hostname = "127.0.0.1"
port = 0
}
akka.remote.log-received-messages = on
akka.remote.log-sent-messages = on
}
cluster {
seed-nodes = [
"akka.tcp://[email protected]:2551",
"akka.tcp://[email protected]:2552"]
auto-down-unreachable-after = 10s
}
}
# Disable legacy metrics in akka-cluster.
akka.cluster.metrics.enabled=off
# Enable metrics extension in akka-cluster-metrics.
akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"]
# Sigar native library extract location during tests.
# Note: use per-jvm-instance folder when running multiple jvm on one host.
akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native