Knowing the cluster Node in the server
Sometimes we need to know which server node we are accessing in cluster environment.
We know that we can execute the "Groovy" and "BeanShell" script in control panel.
So place the following code and execute it, you will be knowing which server we are accessing.
Note: Before execution make necessary imports
ClusterNode clusterNode =ClusterExecutorUtil.getLocalClusterNode();
if (clusterNode != null) {
System.out.println("cluster Node is "+clusterNode.getClusterNodeId());
}
We know that we can execute the "Groovy" and "BeanShell" script in control panel.
So place the following code and execute it, you will be knowing which server we are accessing.
Note: Before execution make necessary imports
ClusterNode clusterNode =ClusterExecutorUtil.getLocalClusterNode();
if (clusterNode != null) {
System.out.println("cluster Node is "+clusterNode.getClusterNodeId());
}
Comments
Post a Comment