Configure health management for Liberty


Overview

Health management in a Liberty collective can prevent the disruption of service by detecting common problems and generating diagnostic actions based on configured health policies. The health management functions are enabled by two Liberty features, health manager and health analyzer.

To gain the full function of the health management feature, enable both the auto scaling and dynamic routing features

In Liberty version 21.0.0.8 and later, we can configure health management with any specification-compliant Java runtime environment (JRE) or Java SDK, including IBM Java 11.

  • In Liberty version 21.0.0.7 and earlier, we must use one of the following IBM Java developer kits for Windows or Linux operating systems to configure health management:

    • Java 8
    • Java 7 Fix Pack 8 and later
    • Java 6 Fix Pack 7 and later

    To download one of these IBM Java developer kits for the operating system, go to the IBM developer kits website.

    Note: In Liberty version 21.0.0.7 and earlier, IBM Java 11 does not provide the necessary resources to configure health management. .

    For Windows users, the root user does not have read/write permission to the C:\Windows\Temp directory unless we are an administrator. We might want to change the permission of the C:\Windows\Temp directory to avoid this issue.

    Note: Health Center generates temporary tmp files in the /tmp space. Depending on /tmp space limits, we might want to change the java.io.tmpdir to avoid filling the /tmp space, which can cause unrecoverable issues on some platforms.

      -Djava.io.tmpdir=/path/to/tmpdir

    We can create health policies for common server health conditions.

    See Health management.

    We can also assign the following actions for health conditions:

    • Capture diagnostics (heap dump and thread dump)
    • Restart server
    • Enter server into maintenance mode
    • Exit server out of maintenance mode. For use within the same health policy, where an earlier action entered maintenance mode prior to performing other actions.

    Watch: Video: Health management


    Procedure

    1. Create a collective.

    2. Add the healthManager-1.0 feature to the feature manager stanza in the server.xml file of one or more collective controllers.

      This feature can be added only to collective controllers.

        <featureManager>
         <feature>jsp-2.2</feature>
         <feature>collectiveController-1.0</feature>
         <feature>healthManager-1.0</feature>
        </featureManager>

      After adding the feature, the following message in the messages.log file of the collective controller, provided the collective controller is running.

        CWWKV0600I: The HealthManager feature is activated.

    3. Add the healthAnalyzer-1.0 feature to the feature manager stanza of the server.xml file of the collective member.

      The healthAnalyzer feature is necessary for monitoring excessive memory usage and memory leak.

        <featureManager>
         <feature>collectiveMember-1.0</feature>
         <feature>healthAnalyzer-1.0</feature>
        </featureManager>

      After adding the feature, the following message displays in the messages.log file of the collective controller, provided the collective controller is running.

        CWWKV0750I: The healthAnalyzer feature has been activated.

      When the healthAnalyzer feature is activated on the collective member, the following message displays in the messages.log file of the collective controller.

        CWWKV0612I: The Health Analyzer is activated in member_host_name,path_to_usr_directory,member_name.

      Note: To activate both healthAnalyzer and scalingMember, the hostSingleton must have a unique port separately set for each service.

        <hostSingleton name="ScalingMemberSingletonService" port="33333">
        <hostSingleton name="HealthAnalyzerSingletonService" port="33334">
        

    4. Configure the collective members to be a part of a server cluster.

    5. Add one or more healthPolicy elements to the server.xml file of the collective controller.

      Each healthPolicy element defines a single health policy. If more than one policy is needed, multiple health policy elements can be added to the server.xml file.

    With health policies enabled, Intelligent Management can monitor collective members for problems, and perform diagnostic actions.