Starting a JMX Manager
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'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 distributed system, the server node will be started as a JMX Manager node.
To force a server to become a JMX Manager node whenever it is started, set the GemFire 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.
gfsh>start server --name=<server-name> --J=-Dgemfire.jmx-manager=true \ --J=-Dgemfire.jmx-manager-start=trueBy 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.
gfsh>start locator --name=locator1 Starting a GemFire Locator in /home/stymon/test2/locator1... ............................................ Locator in /home/stymon/test2/locator1 on ubuntu.local as locator1 is currently online. Process ID: 2081 Uptime: 30 seconds GemFire Version: 8.0.0 Java Version: 1.7.0_65 Log File: /home/stymon/test2/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: /home/stymon/Pivotal_GemFire_800_b48319_Linux/lib/locator-dependencies.jar:/usr/local/java/lib/tools.jar Successfully connected to: [host=ubuntu.local, port=1099] Cluster configuration service is up and running.Or you can enter the command directly in your terminal:
stymon@ubuntu:~$ gfsh start locator --name=locator1 .................................... Locator in /home/stymon/locator1 on ubuntu.local as locator1 is currently online. Process ID: 2359 Uptime: 21 seconds GemFire Version: 8.0.0 Java Version: 1.7.0_65 Log File: /home/stymon/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: /home/stymon/Pivotal_GemFire_800_b48319_Linux/lib/locator-dependencies.jar:/usr/local/java/lib/tools.jar Successfully connected to: [host=ubuntu.local, 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.
Configuring a JMX Manager
In the 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 jmx-manager is false.||7070|
|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 http-service-port, then GemFire binds the HTTP service to the member's local address.||not set|
If true then this member can become a JMX Manager. All other jmx-manager-* properties are used when it does become a JMX Manager. If this property is false then all other jmx-manager-* properties are ignored.
The default value is true on locators.
|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 com.sun.management.jmxremote.access.file system property. Ignored if jmx-manager is false or if jmx-manager-port is zero. See Setting Up JMX Authentication for GemFire Management and Monitoring for more information.
|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 GemFire 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.See Setting Up JMX Authentication for GemFire Management and Monitoring for more information.||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-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 GemFire 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 GemFire 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.
gfsh>stop locator --dir=locator1 Stopping Locator running in /home/stymon/test2/locator1 on ubuntu.local as locator1... Process ID: 2081 Log File: /home/stymon/test2/locator1/locator1.log .... No longer connected to ubuntu.local.For a server:
gfsh>stop server --dir=server1 Stopping Cache Server running in /home/stymon/test2/server1 ubuntu.local as server1... Process ID: 1156 Log File: /home/stymon/test2/server1/server1.log .... No longer connected to ubuntu.local.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.