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());
}



Comments

Popular posts from this blog

Theme display in javascript

How to know which liferay version we are using

Viewing the SQL Query in liferay : debugging the SQL Query in Hibernate