Created
January 28, 2013 15:47
-
-
Save nshaw/4656615 to your computer and use it in GitHub Desktop.
Display the details of nodes visible to a cluster.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import com.liferay.portal.kernel.cluster.ClusterExecutorUtil | |
| import com.liferay.portal.kernel.cluster.ClusterNode | |
| try { | |
| println "Clustering enabled: " + ClusterExecutorUtil.isEnabled() | |
| List<ClusterNode> nodes = ClusterExecutorUtil.getClusterNodes() | |
| println "Number of nodes: " + nodes.size() | |
| for (ClusterNode node : nodes) { | |
| println node.getHostName() + "," + | |
| node.getInetAddress() + "," + | |
| node.getPort() + "," + | |
| node.getClusterNodeId() | |
| } | |
| } | |
| catch (Exception e) { | |
| println e.getMessage() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment