3 changed files with 111 additions and 2 deletions
@ -0,0 +1,109 @@
@@ -0,0 +1,109 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" |
||||
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd"> |
||||
<chapter id="mongo.jmx"> |
||||
<title>JMX support</title> |
||||
|
||||
<para>The JMX support for MongoDB exposes the results of executing the |
||||
'serverStatus' command on the admin database for a single MongoDB server |
||||
instance. It also exposes an administrative MBean, MongoAdmin which will let |
||||
you perform administrative operations such as drop or create a database. The |
||||
JMX features build upon the JMX feature set available in the Spring |
||||
Framework. See <ulink |
||||
url="http://static.springsource.org/spring/docs/3.0.x/reference/jmx.html">here</ulink> |
||||
for more details.</para> |
||||
|
||||
<section id="mongodb:jmx-configuration"> |
||||
<title>MongoDB JMX Configuration</title> |
||||
|
||||
<para>Spring's Mongo namespace enables you to easily enable JMX |
||||
functionality</para> |
||||
|
||||
<example> |
||||
<title>XML schmea to configure MongoDB</title> |
||||
|
||||
<programlisting language="xml"><?xml version="1.0" encoding="UTF-8"?> |
||||
<beans xmlns="http://www.springframework.org/schema/beans" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xmlns:context="http://www.springframework.org/schema/context" |
||||
xmlns:mongo="http://www.springframework.org/schema/data/mongo" |
||||
xsi:schemaLocation= |
||||
"http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd |
||||
http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd |
||||
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> |
||||
|
||||
<beans> |
||||
|
||||
<!-- Default bean name is 'mongo' --> |
||||
<mongo:mongo host="localhost" port="27017"/> |
||||
|
||||
<!-- by default look for a Mongo object named 'mongo' --> |
||||
<mongo:jmx/> |
||||
|
||||
<context:mbean-export/> |
||||
|
||||
<!-- To translate any MongoExceptions thrown in @Repository annotated classes --> |
||||
<context:annotation-config/> |
||||
|
||||
<bean id="registry" class="org.springframework.remoting.rmi.RmiRegistryFactoryBean" |
||||
p:port="1099" /> |
||||
|
||||
<!-- Expose JMX over RMI --> |
||||
<bean id="serverConnector" class="org.springframework.jmx.support.ConnectorServerFactoryBean" |
||||
depends-on="registry" |
||||
p:objectName="connector:name=rmi" |
||||
p:serviceUrl="service:jmx:rmi://localhost/jndi/rmi://localhost:1099/myconnector" /> |
||||
|
||||
</beans> |
||||
</programlisting> |
||||
</example> |
||||
|
||||
<para>This will expose several MBeans </para> |
||||
|
||||
<itemizedlist> |
||||
<listitem> |
||||
<para>AssertMetrics</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>BackgroundFlushingMetrics</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>BtreeIndexCounters</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>ConnectionMetrics</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>GlobalLoclMetrics</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>MemoryMetrics</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>OperationCounters</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>ServerInfo</para> |
||||
</listitem> |
||||
|
||||
<listitem> |
||||
<para>MongoAdmin</para> |
||||
</listitem> |
||||
</itemizedlist> |
||||
|
||||
<para>This is shown below in a screenshot from JConsole</para> |
||||
|
||||
<mediaobject> |
||||
<imageobject> |
||||
<imagedata fileref="..\resources\images\jconsole.png" /> |
||||
</imageobject> |
||||
</mediaobject> |
||||
</section> |
||||
</chapter> |
||||
|
After Width: | Height: | Size: 28 KiB |
Loading…
Reference in new issue