JMX Access to EAP 6 Host Controller: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 10: Line 10:
=Overview=
=Overview=


JBoss Remoting provides the transport of the [[JSR 160 Java Management Extensions (JMX) Remote API|JSR-160 Java Management Extensions (JMX) Remote API]] compliant implementation of a [[JMXConnector]] that can be used by standard monitoring applications to access the JMX bus.
A generic JMX client connects to a EAP 6 host controller instance using [[WildFly_Management_Interfaces#The_Native_API_Endpoint|the native endpoint of the host controller management interface]]. For an in-depth explanation on how that works, see [[Remoting_WildFly_Subsystem_Concepts#Remoting_and_JMX_Access|Remoting Concepts - Remoting and JMX Access]]. Specific JBoss libraries must be added to the generic client's classpath, and we will show how those can be added for Visual VM and jconsole. Also, the access must be secured by adding a specific user (or using an existing user) to the management realm associated with the native management interface, on that specific host controller.
 
=Server Endpoint=
 
The generic JMX client must connect to [[WildFly_Management_Interfaces#The_Native_API_Endpoint|the native endpoint of the standalone instance's management interface]].
 
The host address and port binding for the endpoint are specified as "management-native" socket binding:
 
<pre>
<socket-binding-group name="standard-sockets" ...>
    ...
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
</socket-binding-group>
</pre>
 
The port value is 9999.
 
<blockquote style="background-color: Gold; border: solid thin Goldenrod;">
:<br>If the standalone instance runs with a specific port offset, the management endpoint port value must account for that offset.<br><br>
</blockquote>
 
The actual value for the management interface bind address is specified under the related "management" interface specification:
 
<pre>
<interfaces>
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
    </interface>
  ...
</interfaces>
</pre>
 
Unless explicitly re-configured, the default bind address for the management interface is 127.0.0.1.
 
The bind address and the port are reported as INFO, as follows:
 
<pre>
16:15:51,187 INFO  [org.jboss.as.remoting] (MSC service thread 1-15) JBAS017100: Listening on 127.0.0.1:9999
</pre>
 
The bind address and port will be needed when assembling [[#URL|the URL to be used by the JMX client]], below.
 
==Server Endpoint Authentication==
 
A generic JMX client usually provides a username and a password when connecting. Those values must be explicitly added to the Management Realm of the server instance we connect to. The procedure to add a user to the Management Realm is presented in detail here:
 
<blockquote style="background-color: #f9f9f9; border: solid thin lightgrey;">
:[[Adding_Users_to_WildFly_Security_Realms#Add_a_User_to_the_Management_Realm|Add a User to the Managment Realm]]
</blockquote>
 
Note that no specific group is necessary to be specified during the procedure.
 
=JMX Client=
 
The generic JMX client must ''add client JBoss libraries'' to its class path and must ''set up JBoss specific system properties'', as shown below. It also must use ''a specific URL to connect'', and the user and the password configured on the server, as described in the "[[#Server_Endpoint_Authentication|Server Endpoint Authentication]]" section.
 
==JMX Client Classpath and Startup Options==
 
The JBoss JAR <tt>$JBOSS_HOME/bin/client/jboss-cli-client.jar</tt> must be added to the JMX client classpath. Also, the JMX client must be started with <tt>-Dmodule.path=${JBOSS_HOME}/modules</tt>. Specific details for a number of clients are available below:
 
* [[Jconsole#jconsole_Classpath_and_Startup_Options|jconsole]]
* [[Using VisualVM with WildFly|VisualVM]]
* [[Dynatrace#JMX_Connection_to_JBoss|Dynatrace]]
* [[DataDog]]
 
==URL==
 
Use:
 
<pre>
service:jmx:remoting-jmx://<server-host>:9999
</pre>
 
where <server-host> is the interface the native management endpoint is bound to. If the client and server are collocated, that is usually 127.0.0.1.
 
==Authentication==
 
Use the username and the password configured on the server, as described in the "[[#Server_Endpoint_Authentication|Server Endpoint Authentication]]" section.
 
==SSL Connection Configuration==
 
<blockquote style="background-color: AliceBlue; border: solid thin LightSteelBlue;">
:<br><font color=red>TODO, come up with the full procedure, until then, more details are available here: https://access.redhat.com/solutions/632773<br><br></font>
</blockquote>

Revision as of 21:45, 18 October 2016

External

Internal

Overview

A generic JMX client connects to a EAP 6 host controller instance using the native endpoint of the host controller management interface. For an in-depth explanation on how that works, see Remoting Concepts - Remoting and JMX Access. Specific JBoss libraries must be added to the generic client's classpath, and we will show how those can be added for Visual VM and jconsole. Also, the access must be secured by adding a specific user (or using an existing user) to the management realm associated with the native management interface, on that specific host controller.

Server Endpoint

The generic JMX client must connect to the native endpoint of the standalone instance's management interface.

The host address and port binding for the endpoint are specified as "management-native" socket binding:

<socket-binding-group name="standard-sockets" ...>
    ...
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>
</socket-binding-group>

The port value is 9999.


If the standalone instance runs with a specific port offset, the management endpoint port value must account for that offset.

The actual value for the management interface bind address is specified under the related "management" interface specification:

<interfaces>
    <interface name="management">
        <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
    </interface>
   ...
</interfaces>

Unless explicitly re-configured, the default bind address for the management interface is 127.0.0.1.

The bind address and the port are reported as INFO, as follows:

16:15:51,187 INFO  [org.jboss.as.remoting] (MSC service thread 1-15) JBAS017100: Listening on 127.0.0.1:9999

The bind address and port will be needed when assembling the URL to be used by the JMX client, below.

Server Endpoint Authentication

A generic JMX client usually provides a username and a password when connecting. Those values must be explicitly added to the Management Realm of the server instance we connect to. The procedure to add a user to the Management Realm is presented in detail here:

Add a User to the Managment Realm

Note that no specific group is necessary to be specified during the procedure.

JMX Client

The generic JMX client must add client JBoss libraries to its class path and must set up JBoss specific system properties, as shown below. It also must use a specific URL to connect, and the user and the password configured on the server, as described in the "Server Endpoint Authentication" section.

JMX Client Classpath and Startup Options

The JBoss JAR $JBOSS_HOME/bin/client/jboss-cli-client.jar must be added to the JMX client classpath. Also, the JMX client must be started with -Dmodule.path=${JBOSS_HOME}/modules. Specific details for a number of clients are available below:

URL

Use:

service:jmx:remoting-jmx://<server-host>:9999

where <server-host> is the interface the native management endpoint is bound to. If the client and server are collocated, that is usually 127.0.0.1.

Authentication

Use the username and the password configured on the server, as described in the "Server Endpoint Authentication" section.

SSL Connection Configuration


TODO, come up with the full procedure, until then, more details are available here: https://access.redhat.com/solutions/632773