Enabling cache monitoring

HCL Commerce provides a Dynamic Cache Monitor application for displaying cache statistics, edge side and disk statistics, cache entries, dependency IDs, and cache policy information. A cache monitor is an installable web application that provides a real-time view of the current state of dynamic cache.

Procedure

Install and open the cache monitor for each server that you want to view cache statistics for.
OptionDescription
Production environment: Liberty Server (Store server and Search server) To configure cache monitoring on Liberty within a Docker container:
  1. Create an XML file, cachemonitor.xml, containing the following configuration.
    <server>
      <featureManager>
        <feature>webCacheMonitor-1.0</feature>
        <feature>restConnector-1.0</feature>
        <feature>appSecurity-2.0</feature>
      </featureManager>
    
      <administrator-role>
        <user>wcsadmin</user>
      </administrator-role>
      
      <basicRegistry id="Cache Monitor" realm="Cache Monitor">
        <user name="wcsadmin" password="password"></user>
      </basicRegistry>
    </server> 
    
    Note:
    • The restConnector-1.0 and appSecurity-2.0 features are required to run Cache Monitor securely.
    • Set the user name and password values for basic authentication to access the Cache Monitor application.

      This basic authentication is not required, and can be removed from the configuration file.

    • If you are using this basic authentication, ensure that your server.xml configuration file. located at Liberty_installdir/usr/servers/default/server.xml, does not already contain an empty basicRegistry configuration. For example, <basicRegistry></basicRegistry>. If it does, this empty configuration can be commented out or removed.
  2. Copy the cachemonitor.xml configuration file into the Liberty /configDropins/overrides/ directory within your Docker container.

    This can be done within your Dockerfile configuration file at the time of your Docker container deployment, via the COPY command.

    For example:
    COPY cachemonitor.xml /opt/WebSphere/Liberty/usr/servers/default/configDropins/overrides/
  3. Ensure that you have network access to the Cache Monitor application.

    In a Kubernetes environment, Cache Monitor needs access to be granted for each pod by using the port-forward command.

    For example:
    kubectl port-forward POD_NAME -n commerce 8483:8483
    Warning: When enabling access, ensure that this URL is not made accessible to those outside of your organization.
  4. Access the Cache Monitor application.
    For the Store server, you can access the Cache Monitor in your browser by navigating to https://localhost:8483/cachemonitor.
    Note: For the Search server, the default port is 3738.
Production environment: WebSphere Application Server (Transaction server) To configure cache monitoring on WebSphere Application Server within a Docker container:
  1. Utilize the following Transaction server Run Engine commands, by entering the following into your Docker container Dockerfile configuration files before deployment.
  2. Ensure that you have network access to the Cache Monitor application.

    In a Kubernetes environment, Cache Monitor needs access to be granted for each pod by using the port-forward command.

    For example:
    kubectl port-forward POD_NAME -n commerce 5080:5080
    Warning: When enabling access, ensure that this URL is not made accessible to those outside of your organization.
Developer environment: To configure cache monitoring within your development environment:

Complete the following steps for each application server that you want to enable cache monitoring on.

  1. Install the cache monitor feature by using the installUtility.bat utility script within the Liberty or WebSphere Application Server \bin\ directory.
    • Liberty:
      Liberty_installdir\bin\installUtility install webCacheMonitor-1.0
    • WebSphere Application Server:
      WAS_installdir\bin\installUtility install webCacheMonitor-1.0
  2. Open the server.xml configuration file for editing. This file is found at the following location.
    • Liberty: Liberty_installdir/usr/servers/default/server.xml
    • WebSphere Application Server: WAS_installdir/wasprofile/config/cells/localhost/nodes/localhost/servers/server1/server.xml
  3. Add the feature.
    <feature>webCacheMonitor-1.0</feature>
  4. Save and close the file.
  5. Start or restart the servers where you have enabled the Cache Monitor application.
  6. Open the Cache Monitor application in your browser:
    • On the Transaction server: http://localhost/cachemonitor
    • On the Search server: http://localhost:3737/cachemonitor
    • On the Store server: http://localhost:8080/cachemonitor