此内容没有您所选择的语言版本。
Chapter 5. Management
5.1. CLI 复制链接链接已复制到粘贴板!
You can use the CLI to perform management operations on a standalone node or a domain controller.
The CLI is extremely powerful and supports a number of useful features to navigate the management resource tree as well as inspecting single resources or entire subtrees. It is also possible to batch multiple commands together so that they are applied as a single operation.
5.2. Console 复制链接链接已复制到粘贴板!
You can use the web console to perform management operations on servers running in either standalone or domain mode. The console only supports a subset of the operations provided by the CLI, however you can perform the following actions:
- View/Edit Cache Container Configuration
- Execute Tasks across Containers
- View/Edit Cache Configurations
- Create/Destroy Cache Instances
- View Cluster/Server/Cache Statistics
- View event logs
- Start/Stop servers/clusters (domain mode only)
To access the console start your server(s) in the required mode, navigate to http://localhost:9990 and enter your user credentials. If you would like to contribute to the development of the console, the source code can be found here.
Before you can use the web console, you must first setup at least one user account via the ./bin/add-user.sh script. Detailed instructions of this process are presented in your browser if you attempt to access the console before creating any user accounts.
5.3. JMX 复制链接链接已复制到粘贴板!
You can monitor an Red Hat Data Grid Server over JMX in two ways:
- Use JConsole or VisualVM running locally as the same user. This will use a local jvmstat connection and requires no additional setup
- Use JMX remoting (aka JSR-160) to connect from any host. This requires connecting through the management port (usually 9990) using a special protocol which respects the server security configuration
To setup a client for JMX remoting, add $RHDG_HOME/bin/client/jboss-cli-client.jar to your client’s classpath and use one of the following service URLs:
-
service:jmx:remote+http://hostname:9990for plain connections through the management interface -
service:jmx:remote+https://hostname:9993for TLS connections through the management interface (although this requires having the appropriate keys available)
The JMX subsystem registers a service with the Remoting endpoint so that remote access to JMX can be obtained over the exposed Remoting connector. This is switched on by default in standalone mode and accessible over port 9990 but in domain mode it is switched off so it needs to be enabled. In domain mode the port will be the port of the Remoting connector for the Server instance to be monitored.
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector use-management-endpoint="false"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector use-management-endpoint="false"/>
</subsystem>
5.4. Exposing JMX Beans to Prometheus 复制链接链接已复制到粘贴板!
Start Red Hat Data Grid servers as follows:
./standalone.sh -c cloud.xml --jmx 8180:my-config.yaml
$ ./standalone.sh -c cloud.xml --jmx 8180:my-config.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
5.5. Access Logs 复制链接链接已复制到粘贴板!
Hot Rod and REST endpoints can record all inbound client requests as log entries with the following categories:
-
org.infinispan.HOTROD_ACCESS_LOGlogging category for the Hot Rod endpoint. -
org.infinispan.REST_ACCESS_LOGlogging category for the REST endpoint.
5.5.1. Enabling Access Logs 复制链接链接已复制到粘贴板!
Access logs for Hot Rod and REST endpoints are disabled by default. To enable either logging category, set the level to TRACE in the server configuration file, as in the following example:
5.5.2. Access Log Properties 复制链接链接已复制到粘贴板!
The default format for access logs is as follows:
%X{address} %X{user} [%d{dd/MMM/yyyy:HH:mm:ss z}] "%X{method} %m %X{protocol}" %X{status} %X{requestSize} %X{responseSize} %X{duration}%n
The preceding format creates log entries such as the following:
127.0.0.1 - [30/Oct/2018:12:41:50 CET] "PUT /rest/default/key HTTP/1.1" 404 5 77 10
Logging properties use the %X{name} notation and let you modify the format of access logs. The following are the default logging properties:
| Property | Description |
|---|---|
|
|
Either the |
|
| Principal name, if using authentication. |
|
|
Method used. |
|
|
Protocol used. |
|
|
An HTTP status code for the REST endpoint. |
|
| Size, in bytes, of the request. |
|
| Size, in bytes, of the response. |
|
| Number of milliseconds that the server took to handle the request. |
Use the header name prefixed with h: to log headers that were included in requests; for example, %X{h:User-Agent}.