Chapter 16. Troubleshooting Data Grid Server deployments
Gather diagnostic information about Data Grid Server deployments and perform troubleshooting steps to resolve issues.
16.1. Getting diagnostic reports from Data Grid Server Copy linkLink copied to clipboard!
Data Grid Server provides aggregated reports in tar.gz
archives that contain diagnostic information about server instances and host systems. The report provides details about CPU, memory, open files, network sockets and routing, threads, in addition to configuration and log files.
Procedure
- Create a CLI connection to Data Grid Server.
Use the
server report
command to download atar.gz
archive:server report Downloaded report 'infinispan-<hostname>-<timestamp>-report.tar.gz'
server report Downloaded report 'infinispan-<hostname>-<timestamp>-report.tar.gz'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command responds with the name of the report, as in the following example:
Downloaded report 'infinispan-<hostname>-<timestamp>-report.tar.gz'
Downloaded report 'infinispan-<hostname>-<timestamp>-report.tar.gz'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Move the
tar.gz
file to a suitable location on your filesystem. -
Extract the
tar.gz
file with any archiving tool.
16.2. Changing Data Grid Server logging configuration at runtime Copy linkLink copied to clipboard!
Modify the logging configuration for Data Grid Server at runtime to temporarily adjust logging to troubleshoot issues and perform root cause analysis.
Modifying the logging configuration through the CLI is a runtime-only operation, which means that changes:
-
Are not saved to the
log4j2.xml
file. Restarting server nodes or the entire cluster resets the logging configuration to the default properties in thelog4j2.xml
file. - Apply only to the nodes in the cluster when you invoke the CLI. Nodes that join the cluster after you change the logging configuration use the default properties.
Procedure
- Create a CLI connection to Data Grid Server.
Use the
logging
to make the required adjustments.List all appenders defined on the server:
logging list-appenders
logging list-appenders
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command provides a JSON response such as the following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow List all logger configurations defined on the server:
logging list-loggers
logging list-loggers
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command provides a JSON response such as the following:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add and modify logger configurations with the
set
subcommandFor example, the following command sets the logging level for the
org.infinispan
package toDEBUG
:logging set --level=DEBUG org.infinispan
logging set --level=DEBUG org.infinispan
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Remove existing logger configurations with the
remove
subcommand.For example, the following command removes the
org.infinispan
logger configuration, which means the root configuration is used instead:logging remove org.infinispan
logging remove org.infinispan
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
16.3. Gathering resource statistics from the CLI Copy linkLink copied to clipboard!
You can inspect server-collected statistics for some Data Grid Server resources with the stats
command.
Use the stats
command either from the context of a resource that provides statistics (containers, caches) or with a path to such a resource:
stats
stats
stats /containers/default/caches/mycache
stats /containers/default/caches/mycache
16.4. Accessing cluster health via REST Copy linkLink copied to clipboard!
Get Data Grid cluster health via the REST API.
Procedure
Invoke a
GET
request to retrieve cluster health.GET /rest/v2/cache-managers/{cacheManagerName}/health
GET /rest/v2/cache-managers/{cacheManagerName}/health
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Data Grid responds with a JSON
document such as the following:
Get cache manager status as follows:
GET /rest/v2/cache-managers/{cacheManagerName}/health/status
GET /rest/v2/cache-managers/{cacheManagerName}/health/status
Reference
See the REST v2 (version 2) API documentation for more information.
16.5. Accessing cluster health via JMX Copy linkLink copied to clipboard!
Retrieve Data Grid cluster health statistics via JMX.
Procedure
Connect to Data Grid server using any JMX capable tool such as JConsole and navigate to the following object:
org.infinispan:type=CacheManager,name="default",component=CacheContainerHealth
org.infinispan:type=CacheManager,name="default",component=CacheContainerHealth
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Select available MBeans to retrieve cluster health statistics.