Starting a JMX Manager
JMX Manager nodes are members that manage other Geode members (as well as themselves). A JMX Manager node can manage all other members in the cluster. Typically a locator will function as the JMX Manager, but you can also turn any other member such as a server into a JMX Manager node as well.
To allow a server to become a JMX Manager you configure Geode property jmx-manager=true
, in the server’sgemfire.properties
file. This property configures the node to become a JMX Manager node passively; if gfsh cannot locate a JMX Manager when connecting to the cluster, the server node will be started as a JMX Manager node.
Note:
The default property setting for all locators is gemfire.jmx-manager=true
. For other members, the default property setting is gemfire.jmx-manager=false
.
To force a server to become a JMX Manager node whenever it is started, set the Geode properties jmx-manager-start=true
and jmx-manager=true
in the server’s gemfire.properties file. Note that both of these properties must be set to true for the node.
To start the member as a JMX Manager node on the command line, provide--J=-Dgemfire.jmx-manager-start=true and --J=-Dgemfire.jmx-manager=true
as arguments to either the start server
or start locator
command.
For example, to start a server as a JMX Manager on the gfsh command line:
gfsh>start server --name=<server-name> --J=-Dgemfire.jmx-manager=true \
--J=-Dgemfire.jmx-manager-start=true
By default, any locator can become a JMX Manager when started. When you start up a locator, if no other JMX Manager is detected in the cluster, the locator starts one automatically. If you start a second locator, it will detect the current JMX Manager and will not start up another JMX Manager unless the second locator’s gemfire.jmx-manager-start
property is set to true.
For most deployments, you only need to have one JMX Manager per cluster. However, you can run more than one JMX Manager if necessary. If you want to provide high-availability and redundancy for the Pulse monitoring tool, or if you are running additional JMX clients other than gfsh, then use the jmx-manager-start=true
property to force individual nodes (either locators or servers) to become JMX Managers at startup. Since there is some performance overhead to being a JMX Manager, we recommend using locators as JMX Managers. If you do not want a locator to become a JMX manager, then you must use the jmx-manager=false
property when you start the locator.
After the node becomes a JMX Manager, all other jmx-manager-*
configuration properties listed in Configuring a JMX Manager are applied.
The following is an example of starting a new locator that also starts an embedded JMX Manager (after detecting that another JMX Manager does not exist). In addition, gfsh
also automatically connects you to the new JMX Manager. For example:
gfsh>start locator --name=locator1
Starting a Geode Locator in /Users/username/apache-geode/locator1...
....
Locator in /Users/username/apache-geode/locator1 on 192.0.2.0[10334] as locator1
is currently online.
Process ID: 27144
Uptime: 5 seconds
Geode Version: 1.13
Java Version: 1.8.0_121
Log File: /Users/username/apache-geode/locator1/locator1.log
JVM Arguments: -Dgemfire.enable-cluster-configuration=true
-Dgemfire.load-cluster-configuration-from-dir=false
-Dgemfire.launcher.registerSignalHandlers=true
-Djava.awt.headless=true -Dsun.rmi.dgc.server.gcInterval=9223372036854775806
Class-Path: /Users/username/apache-geode/lib/geode-core-1.2.0.jar
:/Users/username/apache-geode/lib/geode-dependencies.jar
Successfully connected to: JMX Manager [host=192.0.2.0, port=1099]
Cluster configuration service is up and running.
Locators also keep track of all nodes that can become a JMX Manager.
Immediately after creating its cache, the JMX Manager node begins federating the MBeans from other members. After the JMX Manager node is ready, the JMX Manager node sends a notification to all other members informing them that it is a new JMX Manager. The other members then put complete MBean states for themselves into each of their hidden management regions.
At any point, you can determine whether a node is a JMX Manager by using the MemberMXBean isManager() method.
Using the Java API, any managed node that has been configured with jmx-manager=true
can also be turned into a JMX Manager Node by invoking the ManagementService startManager() method.
Note:
If you start the JMX Manager programmatically and wish to enable command processing, you must also add the absolute path of gfsh-dependencies.jar
(located in the lib
directory of your installation) to the CLASSPATH of your application. Do not copy this library to your CLASSPATH, because this library refers to other dependencies in lib
by a relative path.
Configuring a JMX Manager
In the gemfire.properties
file, you configure a JMX manager as follows.
Property | Description | Default |
---|---|---|
http-service-port | If non-zero, then Geode starts an embedded HTTP service that listens on this port. The HTTP service is used to host the Geode Pulse Web application. If you are hosting the Pulse web app on your own Web server, then disable this embedded HTTP service by setting this property to zero. Ignored if jmx-manager is false. |
7070 |
http-service-bind-address | If set, then the Geode member binds the embedded HTTP service to the specified address. If this property is not set but the HTTP service is enabled using http-service-port , then Geode binds the HTTP service to the member’s local address. |
not set |
jmx-manager | If The default value is |
false (with Locator exception) |
jmx-manager-access-file | By default the JMX Manager allows full access to all MBeans by any client. If this property is set to the name of a file, then it can restrict clients to only reading MBeans; they cannot modify MBeans. The access level can be configured differently in this file for each user name defined in the password file. For more information about the format of this file see Oracle’s documentation of the |
not set |
jmx-manager-bind-address | By default, the JMX Manager when configured with a port listens on all the local host’s addresses. You can use this property to configure which particular IP address or host name the JMX Manager will listen on. This property is ignored if jmx-manager is false or jmx-manager-port is zero. This address also applies to the Geode Pulse server if you are hosting a Pulse web application. |
not set |
jmx-manager-hostname-for-clients | Hostname given to clients that ask the locator for the location of a JMX Manager. By default the IP address of the JMX Manager is used. However, for clients on a different network, you can configure a different hostname to be given to clients. Ignored if jmx-manager is false or if jmx-manager-port is zero. |
not set |
jmx-manager-password-file | By default the JMX Manager allows clients without credentials to connect. If this property is set to the name of a file, only clients that connect with credentials that match an entry in this file will be allowed. Most JVMs require that the file is only readable by the owner. For more information about the format of this file see Oracle’s documentation of the com.sun.management.jmxremote.password.file system property. Ignored if jmx-manager is false or if jmx-manager-port is zero. | not set |
jmx-manager-port | Port on which this JMX Manager listens for client connections. If this property is set to zero, Geode does not allow remote client connections. Alternatively, use the standard system properties supported by the JVM for configuring access from remote JMX clients. Ignored if jmx-manager is false. The Default RMI port is 1099. | 1099 |
jmx-manager-ssl-enabled | If true and jmx-manager-port is not zero, the JMX Manager accepts only SSL connections. The ssl-enabled property does not apply to the JMX Manager, but the other SSL properties do. This allows SSL to be configured for just the JMX Manager without needing to configure it for the other Geode connections. Ignored if jmx-manager is false. |
false |
jmx-manager-start | If true, this member starts a JMX Manager when it creates a cache. In most cases you should not set this property to true because a JMX Manager is automatically started when needed on a member that sets jmx-manager to true. Ignored if jmx-manager is false. |
false |
jmx-manager-update-rate | The rate, in milliseconds, at which this member pushes updates to any JMX Managers. Currently this value should be greater than or equal to the statistic-sample-rate . Setting this value too high causes gfsh and Geode Pulse to see stale values. |
2000 |
Stopping a JMX Manager
To stop a JMX Manager using gfsh, simply shut down the locator or server hosting the JMX Manager.
For a locator:
gfsh>stop locator --dir=locator1
Stopping Locator running in /home/user/test2/locator1 on ubuntu.local[10334] as locator1...
Process ID: 2081
Log File: /home/user/test2/locator1/locator1.log
....
No longer connected to ubuntu.local[1099].
For a server:
gfsh>stop server --dir=server1
Stopping Cache Server running in /home/user/test2/server1 ubuntu.local[40404] as server1...
Process ID: 1156
Log File: /home/user/test2/server1/server1.log
....
No longer connected to ubuntu.local[1099].
Notice that gfsh
has automatically disconnected you from the stopped JMX Manager.
To stop a JMX manager using the management API, use the ManagementService stopManager() method to stop a member from being a JMX Manager.
When a Manager stops, it removes all federated MBeans from other members from its Platform MBeanServer. It also emits a notification to inform other members that it is no longer considered a JMX Manager.