Starting a JMX Manager
JMX Manager nodes are members that manage other GemFire members (as well as themselves). A JMX Manager node can manage all other members in the distributed system. Typically a locator will function as the JMX Manager, but you can also turn any other distributed system member such as a server into a JMX Manager node as well.
To allow a server to become a JMX Manager you configure GemFire property
jmx-manager=true, in the server’s
gemfire.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 distributed system, the server node will be started as a JMX Manager node.
The default property setting for all locators is
gemfire.jmx-manager=true. For other members, the default property setting is
To force a server to become a JMX Manager node whenever it is started, set the GemFire properties
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 distributed system, 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 distributed system. However, you can run more than 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 GemFire Locator in /Users/username/apache-geode/locator1... .... Locator in /Users/username/apache-geode/locator1 on 192.0.2.0 as locator1 is currently online. Process ID: 27144 Uptime: 5 seconds GemFire Version: 9.5 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.
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.
gemfire.properties file, you configure a JMX manager as follows.
|http-service-port||If non-zero, then GemFire starts an embedded HTTP service that listens on this port. The HTTP service is used to host the GemFire 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
|http-service-bind-address||If set, then the GemFire member binds the embedded HTTP service to the specified address. If this property is not set but the HTTP service is enabled using
The default value is
|false (with Locator exception)|
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
|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-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-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, GemFire 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||If true and
|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-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
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 as locator1... Process ID: 2081 Log File: /home/user/test2/locator1/locator1.log .... No longer connected to ubuntu.local.
For a server:
gfsh>stop server --dir=server1 Stopping Cache Server running in /home/user/test2/server1 ubuntu.local as server1... Process ID: 1156 Log File: /home/user/test2/server1/server1.log .... No longer connected to ubuntu.local.
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.