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 creating a health policy, have in mind the target of the policy (server, cluster or host).
  • If you want to gain the full functionality of the health management feature, it is recommended that both the auto scaling and dynamic routing features be enabled. For more information, see Setting up auto scaling for Liberty collectives and Setting up dynamic routing for Liberty collectives.
  • The types of collected resource usage information varies among JRE/JDKs. Go to http://www.ibm.com/developerworks/java/jdk/index.html on the developerWorks website and download an IBM JRE/JDK for your operating system. The developerWorks website does not have a JRE for all operating systems. For example, you must get the JDK from Eclipse for Windows operating systems.
    The following IBM Java versions for Windows and Linux operating systems provide all necessary usage information and are the preferred JRE/JDKs.
    • Java 8
    • Java 7 Fix Pack 8 and above
    • Java 6 Fix Pack 7 and above
  • Note: Health Center generates temporary tmp files in the /tmp space, and 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

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

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 only be added 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.


Icon that indicates the type of topic Task topic

File name: twlp_wve_confighm.html