Cluster config setting to disable jmx, see #2531

This commit is contained in:
Patrik Nordwall 2012-09-20 08:09:01 +02:00
parent 7b06ee5705
commit 068335789c
5 changed files with 12 additions and 3 deletions

View file

@ -27,6 +27,9 @@ akka {
# in case of network partition. # in case of network partition.
auto-down = off auto-down = off
# Enable or disable JMX MBeans for management of the cluster
jmx.enabled = on
# how long should the node wait before starting the periodic tasks maintenance tasks? # how long should the node wait before starting the periodic tasks maintenance tasks?
periodic-tasks-initial-delay = 1s periodic-tasks-initial-delay = 1s

View file

@ -160,8 +160,11 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
system.registerOnTermination(shutdown()) system.registerOnTermination(shutdown())
private val clusterJmx = new ClusterJmx(this, log) private val clusterJmx: Option[ClusterJmx] = {
clusterJmx.createMBean() val jmx = new ClusterJmx(this, log)
jmx.createMBean()
Some(jmx)
}
log.info("Cluster Node [{}] - has started up successfully", selfAddress) log.info("Cluster Node [{}] - has started up successfully", selfAddress)
@ -237,7 +240,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension {
scheduler.close() scheduler.close()
clusterJmx.unregisterMBean() clusterJmx foreach { _.unregisterMBean() }
log.info("Cluster Node [{}] - Cluster node successfully shut down", selfAddress) log.info("Cluster Node [{}] - Cluster node successfully shut down", selfAddress)
} }

View file

@ -36,6 +36,7 @@ class ClusterSettings(val config: Config, val systemName: String) {
final val PublishStatsInterval: FiniteDuration = Duration(getMilliseconds("akka.cluster.publish-stats-interval"), MILLISECONDS) final val PublishStatsInterval: FiniteDuration = Duration(getMilliseconds("akka.cluster.publish-stats-interval"), MILLISECONDS)
final val AutoJoin: Boolean = getBoolean("akka.cluster.auto-join") final val AutoJoin: Boolean = getBoolean("akka.cluster.auto-join")
final val AutoDown: Boolean = getBoolean("akka.cluster.auto-down") final val AutoDown: Boolean = getBoolean("akka.cluster.auto-down")
final val JmxEnabled: Boolean = getBoolean("akka.cluster.jmx.enabled")
final val JoinTimeout: FiniteDuration = Duration(getMilliseconds("akka.cluster.join-timeout"), MILLISECONDS) final val JoinTimeout: FiniteDuration = Duration(getMilliseconds("akka.cluster.join-timeout"), MILLISECONDS)
final val UseDispatcher: String = getString("akka.cluster.use-dispatcher") match { final val UseDispatcher: String = getString("akka.cluster.use-dispatcher") match {
case "" Dispatchers.DefaultDispatcherId case "" Dispatchers.DefaultDispatcherId

View file

@ -33,6 +33,7 @@ object MultiNodeClusterSpec {
akka.cluster { akka.cluster {
auto-join = on auto-join = on
auto-down = off auto-down = off
jmx.enabled = off
gossip-interval = 200 ms gossip-interval = 200 ms
heartbeat-interval = 400 ms heartbeat-interval = 400 ms
leader-actions-interval = 200 ms leader-actions-interval = 200 ms

View file

@ -35,6 +35,7 @@ class ClusterConfigSpec extends AkkaSpec {
JoinTimeout must be(60 seconds) JoinTimeout must be(60 seconds)
AutoJoin must be(true) AutoJoin must be(true)
AutoDown must be(false) AutoDown must be(false)
JmxEnabled must be(true)
UseDispatcher must be(Dispatchers.DefaultDispatcherId) UseDispatcher must be(Dispatchers.DefaultDispatcherId)
GossipDifferentViewProbability must be(0.8 plusOrMinus 0.0001) GossipDifferentViewProbability must be(0.8 plusOrMinus 0.0001)
MaxGossipMergeRate must be(5.0 plusOrMinus 0.0001) MaxGossipMergeRate must be(5.0 plusOrMinus 0.0001)