ACA Blog

ACA Blog

January 2020
« Dec    


Where am I? (how to know which cluster node you’re on)

Dorien JorissenDorien Jorissen

When working with a cluster you pretty quickly come to a point where you want/need to know what cluster node you’re on.


Liferay already has a simple way to show you this. You just need to add the following line to your and hey presto! it shows the current web server node ID in a blue box at the bottom of the page:


While this works perfectly it has one drawback: customers don’t really want to see this in production, while we need it at times to be able to debug a problem. There are a number of ways to solve this catch 22 type of situation:

I want to present a 3rd option: extend the dockbar with a new icon that allows you to display the node ID (and other cluster node specific data). For this we’ll need to override /html/portlet/dockbar/view.jsp and add some code to it.

First is the button which we’ll add right before the Toggle Edit Controls button:

Secondly we’ll need some CSS and Javascript (which we add to the existing aui:script tag) to be able to add an action to our new button that will show a popover with the information we want:

The Javascript code above also adds a keyboard shortcut, SHIFT+N, to the button so that you can even show the popover without even needing to click the button. You can find the complete file here: This will give you the following result:


If you want something similar, but don’t want to add a button to the dockbar, you could use similar code to make the existing blue bar appear/disappear when a shortcut is pressed.