revert Artery config in akka-sample-cluster-scala
This commit is contained in:
parent
dcd921369c
commit
5558caa1f0
11 changed files with 19 additions and 19 deletions
|
|
@ -1,19 +1,20 @@
|
|||
#//#snippet
|
||||
akka {
|
||||
|
||||
actor {
|
||||
provider = "cluster"
|
||||
provider = "akka.cluster.ClusterActorRefProvider"
|
||||
}
|
||||
remote.artery {
|
||||
enabled = on
|
||||
canonical.hostname = 127.0.0.1
|
||||
canonical.port = 0
|
||||
remote {
|
||||
log-remote-lifecycle-events = off
|
||||
netty.tcp {
|
||||
hostname = "127.0.0.1"
|
||||
port = 0
|
||||
}
|
||||
}
|
||||
|
||||
cluster {
|
||||
seed-nodes = [
|
||||
"akka://ClusterSystem@127.0.0.1:2551",
|
||||
"akka://ClusterSystem@127.0.0.1:2552"]
|
||||
"akka.tcp://ClusterSystem@127.0.0.1:2551",
|
||||
"akka.tcp://ClusterSystem@127.0.0.1:2552"]
|
||||
|
||||
#//#snippet
|
||||
# excluded from snippet
|
||||
|
|
@ -36,4 +37,3 @@ akka.extensions=["akka.cluster.metrics.ClusterMetricsExtension"]
|
|||
# Note: use per-jvm-instance folder when running multiple jvm on one host.
|
||||
akka.cluster.metrics.native-library-extract-folder=${user.dir}/target/native
|
||||
#//#snippet
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ object FactorialBackend {
|
|||
def main(args: Array[String]): Unit = {
|
||||
// Override the configuration of the port when specified as program argument
|
||||
val port = if (args.isEmpty) "0" else args(0)
|
||||
val config = ConfigFactory.parseString(s"akka.remote.artery.canonical.port=$port").
|
||||
val config = ConfigFactory.parseString(s"akka.remote.netty.tcp.port=$port").
|
||||
withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]")).
|
||||
withFallback(ConfigFactory.load("factorial"))
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ object SimpleClusterApp {
|
|||
def startup(ports: Seq[String]): Unit = {
|
||||
ports foreach { port =>
|
||||
// Override the configuration of the port
|
||||
val config = ConfigFactory.parseString("akka.remote.artery.canonical.port=" + port).
|
||||
val config = ConfigFactory.parseString("akka.remote.netty.tcp.port=" + port).
|
||||
withFallback(ConfigFactory.load())
|
||||
|
||||
// Create an Akka system
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ object StatsSample {
|
|||
ports foreach { port =>
|
||||
// Override the configuration of the port when specified as program argument
|
||||
val config =
|
||||
ConfigFactory.parseString(s"akka.remote.artery.canonical.port=" + port).withFallback(
|
||||
ConfigFactory.parseString(s"akka.remote.netty.tcp.port=" + port).withFallback(
|
||||
ConfigFactory.parseString("akka.cluster.roles = [compute]")).
|
||||
withFallback(ConfigFactory.load("stats1"))
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ object StatsSampleOneMaster {
|
|||
ports foreach { port =>
|
||||
// Override the configuration of the port when specified as program argument
|
||||
val config =
|
||||
ConfigFactory.parseString(s"akka.remote.artery.canonical.port=" + port).withFallback(
|
||||
ConfigFactory.parseString(s"akka.remote.netty.tcp.port=" + port).withFallback(
|
||||
ConfigFactory.parseString("akka.cluster.roles = [compute]")).
|
||||
withFallback(ConfigFactory.load("stats2"))
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ object TransformationBackend {
|
|||
def main(args: Array[String]): Unit = {
|
||||
// Override the configuration of the port when specified as program argument
|
||||
val port = if (args.isEmpty) "0" else args(0)
|
||||
val config = ConfigFactory.parseString(s"akka.remote.artery.canonical.port=$port").
|
||||
val config = ConfigFactory.parseString(s"akka.remote.netty.tcp.port=$port").
|
||||
withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]")).
|
||||
withFallback(ConfigFactory.load())
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ object TransformationFrontend {
|
|||
def main(args: Array[String]): Unit = {
|
||||
// Override the configuration of the port when specified as program argument
|
||||
val port = if (args.isEmpty) "0" else args(0)
|
||||
val config = ConfigFactory.parseString(s"akka.remote.artery.canonical.port=$port").
|
||||
val config = ConfigFactory.parseString(s"akka.remote.netty.tcp.port=$port").
|
||||
withFallback(ConfigFactory.parseString("akka.cluster.roles = [frontend]")).
|
||||
withFallback(ConfigFactory.load())
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ object StatsSampleSingleMasterSpecConfig extends MultiNodeConfig {
|
|||
// note that no fixed host names and ports are used
|
||||
commonConfig(ConfigFactory.parseString("""
|
||||
akka.loglevel = INFO
|
||||
akka.actor.provider = "cluster"
|
||||
akka.actor.provider = "akka.cluster.ClusterActorRefProvider"
|
||||
akka.remote.log-remote-lifecycle-events = off
|
||||
akka.cluster.roles = [compute]
|
||||
#//#router-deploy-config
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ object StatsSampleSpecConfig extends MultiNodeConfig {
|
|||
// this configuration will be used for all nodes
|
||||
// note that no fixed host names and ports are used
|
||||
commonConfig(ConfigFactory.parseString("""
|
||||
akka.actor.provider = "cluster"
|
||||
akka.actor.provider = "akka.cluster.ClusterActorRefProvider"
|
||||
akka.remote.log-remote-lifecycle-events = off
|
||||
akka.cluster.roles = [compute]
|
||||
#//#router-lookup-config
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ object TransformationSampleSpecConfig extends MultiNodeConfig {
|
|||
// this configuration will be used for all nodes
|
||||
// note that no fixed host names and ports are used
|
||||
commonConfig(ConfigFactory.parseString("""
|
||||
akka.actor.provider = "cluster"
|
||||
akka.actor.provider = "akka.cluster.ClusterActorRefProvider"
|
||||
akka.remote.log-remote-lifecycle-events = off
|
||||
"""))
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Open <a href="#code/src/main/resources/application.conf" class="shortcut">applic
|
|||
|
||||
<p>
|
||||
To enable cluster capabilities in your Akka project you should, at a minimum, add the remote settings,
|
||||
and use <code>cluster</code> for <code>akka.actor.provider</code>. The <code>akka.cluster.seed-nodes</code> should
|
||||
and use <code>akka.cluster.ClusterActorRefProvider</code>. The <code>akka.cluster.seed-nodes</code> should
|
||||
normally also be added to your application.conf file.
|
||||
</p>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue