How to determine the master node?
								
							
								
									 
									
written-by
										
	                       Orsolya Hegedus
										
									 
								
									
									How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!
									While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.
								 
								 
							 
						 
					 
						
							
								
							
							
								
legacy-article								
learn-legacy-article-disclaimer-text							
 
						 
				 
				
						
Issue
- I am running a clustered environment, and I would like to know whether the node I am currently on is the master node.
 
Resolution
- Liferay doesn't have a fixed “master” node in the traditional sense. Instead, it uses a distributed architecture where nodes cooperate to handle requests.
 However, there are concepts of “master” and “slave” nodes in specific contexts, such as job scheduling or cluster management.
- To check if a node is the master for job scheduling, you can use the following Groovy script (multiple options):
import com.liferay.portal.kernel.cluster.*;
out.println("** Master: "+ ClusterMasterExecutorUtil.isMaster());
out.println(com.liferay.portal.kernel.cluster.ClusterMasterExecutorUtil.isMaster());
 
				
				
				
				
					
did-this-article-resolve-your-issue