NOTE: Liferay Support does not recommend or endorse specific third-party products over others. The information provided about products not created by Liferay is for reference purposes only, and any implementation of these principles will be at your team's discretion.
Issue
- Customers who aren't familiar with Docker can't easily setup Kibana in Liferay PaaS.
- How to setup Kibana in Liferay PaaS to monitor Elasticsearch.
Environment
- Liferay PaaS
Notes
- Liferay PaaS includes a Liferay Enterprise Search (LES) subscription which means Elastic's Kibana can be integrated with Liferay DXP.
- These steps have been tested with a recent DXP 7.4 and Elasticsearch 7.x e.g. 7.17.18.
- Ensure you have available PaaS resources (CPU and memory) to allocate to the Kibana service (see DXP Cloud Console > Plan and Usage).
- Ensure your PaaS plan allows deployment of custom services. Check with your Liferay Account Manager if unsure.
- Test the setup in a non production environment first.
- The Liferay PaaS Search service does not have xpack security enabled by default as the endpoints are not publicly facing. As a result some Kibana functionality will not be available for use.
Resolution
1. Add the Kibana custom service in the DXP Cloud workspace:
- Create a new kibana service folder at the same level as the search service folder.
- Copy the attached 'LCP.json' file to the root of the kibana service folder.
- Copy the attached 'Dockerfile' to the root of the kibana service folder.
- Ensure the kibana service version matches the Elasticsearch service version e.g. 7.17.18. See here for the available versions.
- Create a folder called config within the kibana service folder.
- Copy the attached 'kibana.yml' file to the kibana/config folder.
2. Configure the Elasticsearch service in the DXP Cloud workspace:
- Add the following environment variable for the relevant environment(s):
- Name: ENABLE_XPACK_MONITORING
- Value: true
3. Configure the Liferay service in the DXP Cloud workspace:
- Add a config file with the following config file for the relevent environment(s) in liferay/configs/[ENV]/osgi/configs:
- File name:
com.liferay.portal.search.elasticsearch.monitoring.web.internal.configuration.MonitoringConfiguration.config
- File content:
kibanaURL="http://kibana:5601"
- Optionally include the following during development and testing to enable logging:
proxyServletLogEnable=B"true"
4. Generate a Liferay PaaS build and deploy to the relevant environment and confirm all services start as expected.
5. Setup the Elasticsearch Monitoring Page in Liferay DXP:
- Login as an Administrator and choose an appropriate Liferay Site.
- If Private Pages are enabled create a Private Content Page or Widget, otherwise create a (Public) Content Page or Widget Page.
- Add the Elasticsearch Monitoring widget to the page and and Save the page.
- Edit the Page Permissions, remove Guest access to the page and assign access to additional roles as needed.
- Navigate to the page.
- The Elasticsearch Monitoring widget should be rendered on the page.
Alternatively create a custom Panel App (and optionally a custom Panel App Category) to add the widget to the Liferay Control Panel e.g. under Control Panel > Configuration or System using com_liferay_monitoring_web_portlet_MonitoringPortlet as the javax.portlet.name value.