Posts

Showing posts with the label hostname

Display server name or node in the cluster configuration

Image
In Cluster configuration if we want to know which cluster server we have accessed it simple. Liferay has provided a property by which we can know which cluster server we have accessed. Add the following property in the portal-ext.properties # # Set this to true to display the server name at the bottom of every page. # This is useful when testing clustering configurations so that you can know # which node you are accessing. # web.server.display.node=true If we see the internally liferay is using to get the computerName. PortalUtil.getComputerName(); Look into the portalImpl class of constructor how liferay is using to get server node name. _computerName = System.getProperty("env.COMPUTERNAME"); if (Validator.isNull(_computerName)) { _computerName = System.getProperty("env.HOST"); } if (Validator.isNull(_computerName)) { _computerName = System.getProperty("env.HOSTNAME"); } After restarting the server we can see the node ...