0

The geode locator and server are started by the embedded spring data geode running within a spring boot application

Trying to connect with gfsh:

gfsh>connect
Connecting to Locator at [host=localhost, port=10334] ..
Locator could not find a JMX Manager

I am getting this:

Locator could not find a JMX Manager

The application logs for gemfire show:

Starting server location for Distribution Locator on localhost/127.0.0.1[10334]

Also, the logs confirm that these settings were applied:

jmx-manager=true 
jmx-manager-start=true 
locators=localhost[10334]

Why this message then?

Maybe there is any other way to connect to an existing gemfire cache?

ACV
  • 9,964
  • 5
  • 76
  • 81

1 Answers1

2

I'd suggest to use spring-boot-data-geodde directly and start your server and locator as follows:

@SpringBootApplication
@CacheServerApplication(name = "MySpringBootApacheGeodeCacheServerApplication")
@EnableLocator
@EnableManager
public SpringBootApacheGeodeCacheServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(SpringBootApacheGeodeCacheServerApplication.class, args);
    }
}

Please have a look at Embedded (Peer & Server) Cache Applications for further details. Hope this helps, cheers.

Juan Ramos
  • 1,421
  • 1
  • 8
  • 13
  • Thank you @Juan Ramos, but adding `@CacheServerApplication(name = "MySpringBootApacheGeodeCacheServerApplication") @EnableLocator @EnableManager` just doesn't help... – ACV Jul 24 '19 at 14:18
  • What do you mean?. I've just tried again from scratch and it works just fine... do you get any specific errors?. – Juan Ramos Jul 24 '19 at 14:51
  • let me try from scratch, I just tried adding those annotations on existing app, but I'll try from scratch. I am trying `Locator could not find a JMX Manager` then trying to connect. That's all I get. No, the spring app itself works fine, no exceptions – ACV Jul 24 '19 at 15:56
  • Can you follow step by step the instructions shown in [Embedded (Peer & Server) Cache Applications](https://docs.spring.io/autorepo/docs/spring-boot-data-geode-build/1.0.0.RELEASE/reference/html5/#geode-peercache-applications) and make sure you have the correct libraries?. I've tried with an empty project from scratch using those instructions and it works just fine. – Juan Ramos Jul 24 '19 at 19:00
  • Are you certain the (embedded) Manager (service) is actually starting up? For instance, is there some `BindException` happening, perhaps? (NOTE: The default port used by the Manger is `1099`). You can configure the log-level of GemFire/Geode using the `logLevel` attribute on the `@PeerCacheApplication` or `@CacheServerApplication` annotation (`logLevel` defaults to `config`, which should be sufficient, but...). Alternately you can use the `@EnableLogging` annotation. Do you have an example you can share with us, preferably on GitHub? – John Blum Jul 25 '19 at 02:04
  • 1
    Also, seeing an example with code/configuration, and particularly a `pom.xml`, will help us verify that all the stars are aligned (e.g. like product versions). For instance, GemFire/Geode has a inconvenient restriction that the _Gfsh_ version must match the Locator/Manager node version, but that usually is pretty explicit, too. Anyway, I understand what you are asking, I simply am less than clear how you are going about things, technically. I don't want to assume anything. So providing your steps in addition to the results will shed more light on your problem. Thank you in advance. – John Blum Jul 25 '19 at 02:14
  • @JohnBlum thanks for the reply. I will adjust with steps, but before that, just confirming from the logs that the locator seems to be starting ```INFO org.apache.geode.distributed.internal.InternalLocator - Starting peer location for Distribution Locator on localhost/127.0.0.1[10334] INFO org.apache.geode.distributed.internal.InternalLocator - Starting Distribution Locator on localhost/127.0.0.1[10334] INFO org.apache.geode.distributed.internal.tcpserver.TcpServer - Locator was created at Thu Jul 25 10:30:15 BST 2019``` – ACV Jul 25 '19 at 09:36
  • 1
    @ACV: can you use `@EnableManager(start = true)` and `@EnableLogging(logLevel = "fine")`?. Once the locator is up and running you should see something like the following in the logs: `Starting jmx manager agent on port 1099`. The `start = true` is not required in general as the manager is started automatically once a request arrives (if `jmx-manager=true`), but manually setting it will force the locator to start the manager during startup. As @John said, anyway, it would be really helpful to have more details, or even an example. – Juan Ramos Jul 25 '19 at 14:22