Removed cluster seed nodes, added 'join.contact-point', changed joining phase, added singleton cluster mode plus misc other changes.
Signed-off-by: Jonas Bonér <jonas@jonasboner.com>
This commit is contained in:
parent
089f50da0d
commit
755408a528
4 changed files with 30 additions and 5 deletions
|
|
@ -8,9 +8,19 @@
|
|||
akka {
|
||||
|
||||
cluster {
|
||||
<<<<<<< HEAD
|
||||
# node to join - the full URI defined by a string on the form of "akka://system@hostname:port"
|
||||
# leave as empty string if the node should be a singleton cluster
|
||||
node-to-join = ""
|
||||
=======
|
||||
join {
|
||||
# contact point on the form of "hostname:port" of a node to try to join
|
||||
# leave as empty string if the node should be a singleton cluster
|
||||
contact-point = ""
|
||||
timeout = 30s
|
||||
max-time-to-retry = 30s
|
||||
}
|
||||
>>>>>>> Removed cluster seed nodes, added 'join.contact-point', changed joining phase, added singleton cluster mode plus misc other changes.
|
||||
|
||||
gossip {
|
||||
initialDelay = 5s
|
||||
|
|
|
|||
|
|
@ -314,6 +314,16 @@ case class Gossiper(system: ActorSystemImpl, remote: RemoteActorRefProvider) {
|
|||
log.info("Node [{}] - Sending [{}] to [{}] through connection [{}]", remoteAddress, command, member.address, connection)
|
||||
connection ! command
|
||||
}
|
||||
|
||||
contactPoint match {
|
||||
case None ⇒ log.info("Booting up in singleton cluster mode")
|
||||
case Some(member) ⇒
|
||||
log.info("Trying to join contact point node defined in the configuration [{}]", member)
|
||||
setUpConnectionTo(member) match {
|
||||
case None ⇒ log.error("Could not set up connection to join contact point node defined in the configuration [{}]", member)
|
||||
case Some(connection) ⇒ tryJoinContactPoint(connection, deadline)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -25,7 +25,11 @@ class ClusterConfigSpec extends AkkaSpec(
|
|||
import settings._
|
||||
FailureDetectorThreshold must be(8)
|
||||
FailureDetectorMaxSampleSize must be(1000)
|
||||
NodeToJoin must be(None)
|
||||
|
||||
JoinContactPoint must be(None)
|
||||
JoinTimeout must be(30 seconds)
|
||||
JoinMaxTimeToRetry must be(30 seconds)
|
||||
|
||||
GossipInitialDelay must be(5 seconds)
|
||||
GossipFrequency must be(1 second)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,12 +74,13 @@ each node hosting some part of the application. Cluster membership and
|
|||
partitioning of the application are decoupled. A node could be a member of a
|
||||
cluster without hosting any actors.
|
||||
|
||||
Single-node Cluster
|
||||
-------------------
|
||||
|
||||
Singleton Cluster
|
||||
-----------------
|
||||
|
||||
If a node does not have a preconfigured contact point to join in the Akka
|
||||
configuration, then it is considered a single-node cluster and will
|
||||
automatically transition from ``joining`` to ``up``. Single-node clusters
|
||||
configuration, then it is considered a singleton cluster (single node cluster)
|
||||
and will automatically transition from ``joining`` to ``up``. Singleton clusters
|
||||
can later explicitly send a ``Join`` message to another node to form a N-node
|
||||
cluster. It is also possible to link multiple N-node clusters by ``joining`` them.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue