How to use GFSH to connect peer to peer environment?

601 views Asked by At

I am running Gemfire HTTP session management model within my application as P2P on a WebSphere. I can see the session logs on WAS. However, I could not find a way to connect it through gfsh from my desktop. I am using default seeting without locator. I would like to monitor Gemfire status, how?

Cache_Peer.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE cache PUBLIC
  "-//GemStone Systems, Inc.//GemFire Declarative Caching 6.5//EN"
  "http://www.gemstone.com/dtd/cache6_6.dtd">

<cache>
   <!-- This is the definition of the default session region -->
<region name="gemfire_modules_sessions">
<region-attributes scope="distributed-ack" enable-gateway="false" data-policy="replicate" statistics-enabled="false">
  </region-attributes>
  </region>
 </cache>
3

There are 3 answers

3
Rahul Diyewar On BEST ANSWER

As mentioned by Jens, Locator by defaults is a JMX manager. 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.

To turn any other member (p2p server) to JMX manager, set jmx-manager=true and jmx-manager-start=true in the server's gemfire.properties file.

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 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

Refer http://gemfire80.docs.pivotal.io/7.0.2/userguide/index.html#managing/management/jmx_manager_operations.html for more details.

2
Jens D On

By default, the locator in a client-server environment, would be a JMX manager. In a p2p setup you need to enable the JMX manager in one of your servers. You can do this by setting the GemFire properties: jmx-manager-enable=true and jmx-manager-start=true. It is also possible to have multiple JMX managers. If your p2p setup only consists of 2 servers, then having both be JMX managers would be OK.

0
Rahul Diyewar On

You can use connect command from gfsh, it connects to the jmx manager.

If you have locator, then connect it using connect --locator=host[port] command, the jmx-manager automatically starts on locator. However, if you don't have locator, then you need to explicitly start jmx-manager on servers and connect it using connect --jmx-manager=host[port] command.

Refer http://gemfire.docs.pivotal.io/latest/userguide/index.html#tools_modules/gfsh/command-pages/connect.html for more details.

If the Gemfire cluster is running behind firewall, then use HTTP to connect, refer http://gemfire.docs.pivotal.io/latest/userguide/index.html#deploying/gfsh/gfsh_remote.html