Skip to content

Commit c3c7081

Browse files
authored
Merge pull request #891 from evolvedbinary/jmx
JMX access over HTTP clarification
2 parents 74738b6 + 4f845f3 commit c3c7081

File tree

1 file changed

+30
-30
lines changed
  • src/main/xar-resources/data/jmx

1 file changed

+30
-30
lines changed

src/main/xar-resources/data/jmx/jmx.xml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:xlink="http://www.w3.org/1999/xlink">
66
<info>
77
<title>Java Management Extensions (JMX)</title>
8-
<date>2Q19</date>
8+
<date>1Q23</date>
99
<keywordset>
1010
<keyword>java-development</keyword>
1111
<keyword>operations</keyword>
@@ -14,42 +14,27 @@
1414

1515
<!-- ================================================================== -->
1616

17-
<para>eXist-db provides access to various management interfaces via Java Management Extensions
18-
(JMX). An agent in the Java virtual machine exposes agent services as so-called MBeans that
19-
belong to different components running within the virtual machine. A JMX-compliant
20-
management application can then connect to the agent through the MBeans and access the
21-
available services in a standardized way. </para>
22-
<para>The standard Java installation includes a simple client, JConsole, which will also display
23-
the eXist-specific services. eXist also provides a command-line client for quick access to
24-
server statistics and other information.</para>
25-
<para>Right now, eXist only exposes a limited set of read-only services. Most of them are useful
26-
for debugging purposes only.</para>
17+
<para>eXist-db provides access to various management interfaces via Java Management Extensions (JMX). An agent in the Java Virtual Machine exposes agent services as <emphasis>MBeans</emphasis> that belong to different components running within the Virtual Machine. A JMX-compliant management application can then connect to the agent through the MBeans and access the available services in a standardized way. </para>
18+
<para>The standard Java installation includes a simple client, JConsole, which will display the eXist-specific services. eXist also provides a command-line client for quick access to server statistics and other information.</para>
19+
<para>eXist only exposes a limited set of read-only services. Most of them are useful for debugging purposes only.</para>
2720

2821
<!-- ================================================================== -->
2922

3023
<sect1 xml:id="enable">
3124
<title>Enabling the JMX agent</title>
32-
33-
<para>To enable the platform server within the host virtual machine, pass the following Java
34-
system properties:</para>
25+
<para>The JMX agent is enabled by default for connections to local processes only: it is not exposed over TCP by default.</para>
26+
<para>To enable the platform server on the host virtual machine over TCP, pass the following Java system properties (e.g. as part of the <code>JAVA_OPTS</code> environment variable):</para>
3527
<programlisting xlink:href="listings/listing-1.txt"/>
3628
<warning>
37-
<para>These options makes the server publicly accessible. Please check the Oracle <link
38-
xlink:href="https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html">
39-
JMX documentation</link> for details.</para>
29+
<para>These options make the server publicly accessible. Please check the Oracle <link xlink:href="https://docs.oracle.com/javase/1.5.0/docs/guide/management/agent.html"> JMX documentation</link> for details.</para>
4030
</warning>
41-
<para>The extension can now be activated by passing a <code>-j</code> or <code>-jmx</code>
42-
command-line parameter to the eXist start scripts (<literal>client.sh</literal>,
43-
<literal>startup.sh</literal> etc.). This parameter must be followed by the port number
44-
through which the JMX/RMI connections are enabled. For instance:</para>
45-
<programlisting xlink:href="listings/listing-2.txt"/>
4631
</sect1>
4732

4833
<!-- ================================================================== -->
4934

5035
<sect1 xml:id="monitoring">
5136
<title>Monitoring and Management</title>
52-
<para>This sections explains how to monitor an exist instant using common java tools.</para>
37+
<para>This section explains how to monitor an eXist instance using common Java tools.</para>
5338

5439

5540

@@ -58,9 +43,12 @@
5843
<sect2 xml:id="jconsole">
5944
<title>Use JConsole</title>
6045

61-
<para>Use a JMX-compliant management console to access the management interfaces. For
62-
example, call JConsole, which is included with the JDK:</para>
63-
<programlisting>jconsole localhost:1099</programlisting>
46+
<para>Use a JMX compliant management console to access the management interfaces. For example, call JConsole, which is included with the JDK:</para>
47+
<programlisting>jconsole</programlisting>
48+
<para>When connecting locally, select the entry starting <code>org.codehaus.mojo.appessembler.booter.Appass...</code> under "Local Proccess"</para>
49+
<para>When connecting remotely over TCP, provide the hostname and port under "Remote Process", or provide them directly from the command line:</para>
50+
<programlisting>jconsole hostname:port</programlisting>
51+
<para>You may be presented with a dialogue box stating that a secure connection could not be established: it should be possible to continue with an insecure connection.</para>
6452
<para>Clicking on the <guimenuitem>MBeans</guimenuitem> tab should show some
6553
eXist-specific MBeans below the standard Java MBeans (in the tree component to the
6654
left).</para>
@@ -167,11 +155,23 @@
167155
<para>For example, to get a report on current memory usage and running instances, use
168156
the following URL:</para>
169157
<programlisting>http://localhost:8080/exist/status?c=memory&amp;c=instances</programlisting>
158+
<note>
159+
<para>The JMX information is only accessible via the HTTP interface when either:</para>
160+
<itemizedlist>
161+
<listitem>
162+
<para>the client accesses the API on localhost</para>
163+
</listitem>
164+
<listitem>
165+
<para>a valid token is provided when accessing the API from a remote IP address. A file containing this token and an example of its use can be found in the eXist data directory at <code>$EXIST_HOME/data/jmxservlet.token</code>.</para>
166+
</listitem>
167+
</itemizedlist>
168+
</note>
169+
<note>
170+
<para>Consider using <link xlink:href="production_web_proxying">a web proxy</link> if you wish to provide this service separately from other eXist applications.</para>
171+
</note>
170172
<para>This returns something like:</para>
171173
<programlisting language="xml" xlink:href="listings/listing-8.xml"/>
172-
<para>The different JMX objects in eXist are organized into categories. One or more
173-
categories can be passed to the servlet in parameter <literal>c</literal>. The
174-
following categories are recognized:</para>
174+
<para>The different JMX objects in eXist are organized into categories. One or more categories can be passed to the servlet in the URL parameter <literal>c</literal>. The following categories are recognized:</para>
175175
<variablelist>
176176
<varlistentry>
177177
<term><code>memory</code></term>
@@ -195,7 +195,7 @@
195195
<varlistentry>
196196
<term><code>system</code></term>
197197
<listitem>
198-
<para>Contains system information: eXist version ...</para>
198+
<para>Contains system information, such as the running eXist version.</para>
199199
</listitem>
200200
</varlistentry>
201201
<varlistentry>

0 commit comments

Comments
 (0)