Post on 06-May-2015
description
Scala
@diego_pacheco Software Architect | Agile Coach
2.2.0
Suécia
Actors
Actors Model
NO Shared Data
Async Messages Lightweight Threads
htt
p:/
/tw
iste
dsi
fter
.sif
ter.
net
dn
a-cd
n.c
om
/wp
-co
nte
nt/
up
load
s/2
01
2/0
2/w
orl
ds-
smal
lest
-an
d-t
inie
st-c
ham
eleo
n-8
00
x50
0.jp
g
5
htt
p:/
/msn
bcm
edia
1.m
sn.c
om
/j/M
SNB
C/C
om
po
nen
ts/P
ho
to/_
new
/11
10
21
-sev
en-b
illio
n-h
med
-12
p.g
rid
-8x2
.jpg
6
Akka: Success Cases
2.2.0
Cluster Support! Hell Yeah, Finally!
Cluster Support! - Fault Tolerance
- Elastic, Scale out
- No SPOF(Single Point of Failure)
- Amazon Dynamo-style / Riak - gossip protocol
- Automatic Failure Detection
Cluster Membership
Cluster Configuration
Cluster Code
Cluster Log – Node 2 [INFO] [08/02/2013 02:43:24.276] [main] [Remoting] Starting remoting [INFO] [08/02/2013 02:43:24.456] [main] [Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@127.0.0.1:2552] [INFO] [08/02/2013 02:43:24.472] [main] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2552] - Starting up... [INFO] [08/02/2013 02:43:24.535] [main] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2552] - Registered cluster JMX MBean [akka:type=Cluster] [INFO] [08/02/2013 02:43:24.535] [main] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2552] - Started up successfully [INFO] [08/02/2013 02:43:24.541] [ClusterSystem-akka.actor.default-dispatcher-3] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2552] - Metrics will be retreived from MBeans, and may be incorrect on some platforms. To increase metric accuracy add the 'sigar.jar' to the classpath and the appropriate platform-specific native libary to 'java.library.path'. Reason: java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar [INFO] [08/02/2013 02:43:24.545] [ClusterSystem-akka.actor.default-dispatcher-3] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2552] - Metrics collection has started successfully [INFO] [08/02/2013 02:43:24.563] [ClusterSystem-akka.actor.default-dispatcher-2] [akka://ClusterSystem/user/clusterListener] Current members: [INFO] [08/02/2013 02:43:24.820] [ClusterSystem-akka.actor.default-dispatcher-12] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2552] - Welcome from [akka.tcp://ClusterSystem@127.0.0.1:2551] [INFO] [08/02/2013 02:43:24.828] [ClusterSystem-akka.actor.default-dispatcher-12] [akka://ClusterSystem/user/clusterListener] Member is Up: akka.tcp://ClusterSystem@127.0.0.1:2551 [INFO] [08/02/2013 02:43:25.259] [ClusterSystem-akka.actor.default-dispatcher-3] [akka://ClusterSystem/user/clusterListener] Member is Up: akka.tcp://ClusterSystem@127.0.0.1:2552
Cluster Log – Node 1 [INFO] [08/02/2013 02:42:26.947] [main] [Remoting] Starting remoting [INFO] [08/02/2013 02:42:27.134] [main] [Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@127.0.0.1:2551] [INFO] [08/02/2013 02:42:27.149] [main] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Starting up... [INFO] [08/02/2013 02:42:27.211] [main] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Registered cluster JMX MBean [akka:type=Cluster] [INFO] [08/02/2013 02:42:27.211] [main] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Started up successfully [INFO] [08/02/2013 02:42:27.217] [ClusterSystem-akka.actor.default-dispatcher-2] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Metrics will be retreived from MBeans, and may be incorrect on some platforms. To increase metric accuracy add the 'sigar.jar' to the classpath and the appropriate platform-specific native libary to 'java.library.path'. Reason: java.lang.ClassNotFoundException: org.hyperic.sigar.Sigar [INFO] [08/02/2013 02:42:27.221] [ClusterSystem-akka.actor.default-dispatcher-2] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Metrics collection has started successfully [INFO] [08/02/2013 02:42:27.234] [ClusterSystem-akka.actor.default-dispatcher-3] [akka://ClusterSystem/user/clusterListener] Current members: [INFO] [08/02/2013 02:42:31.350] [ClusterSystem-akka.actor.default-dispatcher-12] [akka://ClusterSystem/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin$] from Actor[akka://ClusterSystem/system/cluster/core/daemon/firstSeedNodeProcess#-975951196] 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'. [INFO] [08/02/2013 02:42:31.350] [ClusterSystem-akka.actor.default-dispatcher-12] [akka://ClusterSystem/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin$] from Actor[akka://ClusterSystem/system/cluster/core/daemon/firstSeedNodeProcess#-975951196] to Actor[akka://ClusterSystem/deadLetters] 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] [08/02/2013 02:42:31.350] [ClusterSystem-akka.actor.default-dispatcher-12] [akka://ClusterSystem/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin$] from Actor[akka://ClusterSystem/system/cluster/core/daemon/firstSeedNodeProcess#-975951196] 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] [08/02/2013 02:42:31.350] [ClusterSystem-akka.actor.default-dispatcher-12] [akka://ClusterSystem/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin$] from Actor[akka://ClusterSystem/system/cluster/core/daemon/firstSeedNodeProcess#-975951196] to Actor[akka://ClusterSystem/deadLetters] 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] [08/02/2013 02:42:31.350] [ClusterSystem-akka.actor.default-dispatcher-12] [akka://ClusterSystem/deadLetters] Message [akka.cluster.InternalClusterAction$InitJoin$] from Actor[akka://ClusterSystem/system/cluster/core/daemon/firstSeedNodeProcess#-975951196] to Actor[akka://ClusterSystem/deadLetters] 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] [08/02/2013 02:42:32.251] [ClusterSystem-akka.actor.default-dispatcher-2] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Node [akka.tcp://ClusterSystem@127.0.0.1:2551] is JOINING, roles [] [INFO] [08/02/2013 02:42:33.252] [ClusterSystem-akka.actor.default-dispatcher-12] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node [akka.tcp://ClusterSystem@127.0.0.1:2551] to [Up] [INFO] [08/02/2013 02:42:33.254] [ClusterSystem-akka.actor.default-dispatcher-14] [akka://ClusterSystem/user/clusterListener] Member is Up: akka.tcp://ClusterSystem@127.0.0.1:2551 [INFO] [08/02/2013 02:43:24.783] [ClusterSystem-akka.actor.default-dispatcher-12] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Node [akka.tcp://ClusterSystem@127.0.0.1:2552] is JOINING, roles [] [INFO] [08/02/2013 02:43:25.233] [ClusterSystem-akka.actor.default-dispatcher-2] [Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node [akka.tcp://ClusterSystem@127.0.0.1:2552] to [Up] [INFO] [08/02/2013 02:43:25.234] [ClusterSystem-akka.actor.default-dispatcher-5] [akka://ClusterSystem/user/clusterListener] Member is Up: akka.tcp://ClusterSystem@127.0.0.1:2552
Not Quite There Yet - Actor Partitioning
- Actor Handoff
- Actor Rebalancing
- Stateful Actor Replication
Scala
@diego_pacheco Software Architect | Agile Coach
2.2.0 Obrigado!
Thank You!