Configuring health management for Liberty

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.

Before you begin

  • Create the environment that you want to monitor. When you create a health policy, have in mind the target of the policy: server, cluster, or host.
  • If you want to gain the full function of the health management feature, enable both the auto scaling and dynamic routing features For more information, see Setting up auto scaling for Liberty collectives and Setting up dynamic routing for Liberty collectives.
  • In Liberty version 21.0.0.8 and later, you 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, you 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 your 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 platformsFor Windows users, the root user does not have read/write permission to the C:\Windows\Temp directory unless you are an administrator. You 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, you 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

About this task

You can create health policies for common server health conditions. For more information, see Health management.

You 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.

Multimedia Watch: Video: Health management for Liberty collectives provides an overview of health management and demonstrates how it can help find and mitigate problems in your Liberty applications. [Transcript]

Procedure

  1. Create a collective.
    For details on creating a collective controller and member server, see Configuring a Liberty 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 you add 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 you add 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: If you want to activate both the healthAnalyzer and scalingMember features, the hostSingleton specification must have a unique port separately set for each service .
    <hostSingleton name="ScalingMemberSingletonService" port="33333">
    <hostSingleton name="HealthAnalyzerSingletonService" port="33334">
    
  4. If you want to target clusters, you must also configure the collective members to be a part of a server cluster. For more information about server clusters, see Setting up Liberty server clusters.
  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.
    For more information about adding healthPolicy elements to the server.xml file, see Health management policies for Liberty.

Results

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