diff --git a/akka-cluster/src/main/scala/akka/cluster/ClusterJmx.scala b/akka-cluster/src/main/scala/akka/cluster/ClusterJmx.scala index 7da2c2410d..0acd03c036 100644 --- a/akka-cluster/src/main/scala/akka/cluster/ClusterJmx.scala +++ b/akka-cluster/src/main/scala/akka/cluster/ClusterJmx.scala @@ -42,19 +42,31 @@ trait ClusterNodeMBean { * "members": [ * { * "address": "akka.tcp://system@host1:2552", - * "status": "Up" + * "status": "Up", + * "roles": [ + * "frontend" + * ] * }, * { * "address": "akka.tcp://system@host2:2552", - * "status": "Up" + * "status": "Up", + * "roles": [ + * "frontend" + * ] * }, * { * "address": "akka.tcp://system@host3:2552", - * "status": "Down" + * "status": "Down", + * "roles": [ + * "backend" + * ] * }, * { * "address": "akka.tcp://system@host4:2552", - * "status": "Joining" + * "status": "Joining", + * "roles": [ + * "backend" + * ] * } * ], * "unreachable": [ @@ -137,7 +149,10 @@ private[akka] class ClusterJmx(cluster: Cluster, log: LoggingAdapter) { val members = clusterView.members.toSeq.sorted(Member.ordering).map { m ⇒ s"""{ | "address": "${m.address}", - | "status": "${m.status}" + | "status": "${m.status}", + | "roles": [ + | ${m.roles.map("\"" + _ + "\"").mkString(",\n ")} + | ] | }""".stripMargin } mkString (",\n ") diff --git a/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala b/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala index 518efcd681..d81a854379 100644 --- a/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala +++ b/akka-cluster/src/multi-jvm/scala/akka/cluster/MBeanSpec.scala @@ -22,6 +22,7 @@ object MBeanMultiJvmSpec extends MultiNodeConfig { commonConfig(debugConfig(on = false).withFallback(ConfigFactory.parseString(""" akka.cluster.jmx.enabled = on + akka.cluster.roles = [testNode] """)).withFallback(MultiNodeClusterSpec.clusterConfig)) } @@ -119,19 +120,31 @@ abstract class MBeanSpec | "members": [ | { | "address": "${sortedNodes(0)}", - | "status": "Up" + | "status": "Up", + | "roles": [ + | "testNode" + | ] | }, | { | "address": "${sortedNodes(1)}", - | "status": "Up" + | "status": "Up", + | "roles": [ + | "testNode" + | ] | }, | { | "address": "${sortedNodes(2)}", - | "status": "Up" + | "status": "Up", + | "roles": [ + | "testNode" + | ] | }, | { | "address": "${sortedNodes(3)}", - | "status": "Up" + | "status": "Up", + | "roles": [ + | "testNode" + | ] | } | ], | "unreachable": [ diff --git a/akka-docs/rst/java/cluster-usage.rst b/akka-docs/rst/java/cluster-usage.rst index 4864c029cf..385c1cdf41 100644 --- a/akka-docs/rst/java/cluster-usage.rst +++ b/akka-docs/rst/java/cluster-usage.rst @@ -624,6 +624,7 @@ From JMX you can: * see what members that are part of the cluster * see status of this node +* see roles of each member * join this node to another node in cluster * mark any node in the cluster as down * tell any node in the cluster to leave diff --git a/akka-docs/rst/scala/cluster-usage.rst b/akka-docs/rst/scala/cluster-usage.rst index 90248061b2..195257c0a7 100644 --- a/akka-docs/rst/scala/cluster-usage.rst +++ b/akka-docs/rst/scala/cluster-usage.rst @@ -672,6 +672,7 @@ From JMX you can: * see what members that are part of the cluster * see status of this node +* see roles of each member * join this node to another node in cluster * mark any node in the cluster as down * tell any node in the cluster to leave