Hi
Please have a look at this article:-
Link:-http://therealcq.blogspot.in/2014/05/cq5aem-how-do-i-detect-from.html
// How do I detect from a SlingServlet whether it is running on the Master or Slave instance
Basically you can add a message in a log like this:
final String isMaster = repository.getDescriptor("crx.cluster.master");
return StringUtils.isNotBlank(isMaster) && Boolean.parseBoolean(isMaster);
I hope this would help you.
~kautuk
Kautuk Sahni