Este contenido no está disponible en el idioma seleccionado.

Chapter 12. The Health Check API


12.1. The Health Check API

The Health Check API allows users to monitor the health of the cluster, and the caches contained within. This information is particularly important when working in a cloud environment, as it provides a method of querying to report the status of the cluster or cache.

This API exposes the following information:

  • The name of the cluster.
  • The number of machines in the cluster.
  • The overall status of the cluster or cache, represented in one of three values:

    • Healthy - The entity is healthy.
    • Unhealthy - The entity is unhealthy. This value indicates that one or more caches are in a degraded state.
    • Rebalancing - The entity is operational, but a rebalance is in progress. Cluster nodes should not be adjusted when this value is reported.
  • The status of each cache.
  • A tail of the server log.

For information on using the Health Check API through non-programmatic methods, refer to the JBoss Data Grid Administration and Configuration Guide.

12.2. Accessing the Health Check API Programmatically

The Health Check API is only accessible programatically in Library mode, and may be accessed by calling the embeddedCacheManager.getHealth() method.

This method returns an org.infinispan.health.Health object, which has access to the following methods:

  • getClusterHealth() - returns a ClusterHealth object with access to the following methods:

    • getNumberOfNodes() - returns an int representing the number of all nodes in the cluster
    • getNodeNames() - returns a List<String> containing the names of all nodes in the cluster
    • getClusterName() - returns a String containing the name of the cluster
    • getHealthStatus() - returns a HealthStatus that contains the cluster’s health, being reported as HEALTHY, UNHEALTHY, or REBALANCING
  • getHostInfo() - returns a HostInfo object with access to the following methods:

    • getNumberOfCpus() - returns an int containing the number of CPUs installed in the host
    • getTotalMemoryKb() - returns a long containing the total memory in KB
    • getFreeMemoryInKb() - returns a long containing the free memory in KB
  • getCacheHealth() - returns a List<CacheHealth>. Each CacheHealth object has access to the following methods:

    • getCacheName() - returns a String containing the name of the cache
    • getStatus() - returns a HealthStatus that contains the cache’s health, being reported as HEALTHY, UNHEALTHY, or REBALANCING
Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.