0

I have tried so many demos but I am not able to create region on my local gemfire .

my code is running in embedded mode but I want to run it as client server mode with using annotions how should I do this.

Thanks.

1 Answers1

0

Your problem description is pretty vague.

You should have a look at my pivotal-gemfire-clientserver-examples that compares and contrasts using native GemFire configuration (both cache.xml and then using GemFire's Java API) vs. Spring configuration (again using both Spring XML as well as Spring Java configuration meta-data).

For instance, you can see here that I configured and bootstrapped a GemFire Server using Spring Boot along with a Java configuration class. The GemFire cache client is my test class (along with the client-side Java config), but easily could have been another standalone, Spring Boot application.

Another, interesting tidbit, is that you can connect to the Spring Boot, GemFire Server application using Gfsh once the server is up and running. To connect in gfsh, use...

gfsh>connect --jmx-manager=localhost[1199]

Hope this helps!

-John

John Blum
  • 7,381
  • 1
  • 20
  • 30
  • How do we provide username / password? I have gemfire running on Pivotal Cloud – Makky Feb 06 '22 at 09:45
  • If you have your Pivotal Cloud Cache (PCC) service instance in Pivotal CloudFoundry (PCF) setup and configured correctly, then you should not need to explicitly set a username & password. Using the current and supported versions of SBDG 1.5.x and above, SBDG auto-configuration will figure out credentials from the (VCAP) environment for you when the app is pushed (deployed) and bound to the PCC service instance running in PCF. – John Blum Feb 07 '22 at 18:20
  • I am not 100% certain, but I think you are limited to the "configured" users when you setup the PCC service instance in PCF. You can configure multiple users with differing permissions & privileges. When this is the case, then you have an option to set which specific user your _Spring Boot_ app when deployed to PCF, connecting to the PCC service instance, will run as. See the docs for more details: https://docs.spring.io/spring-boot-data-geode-build/current/reference/html5/#cloudfoundry ... – John Blum Feb 07 '22 at 18:23
  • And, specifically: https://docs.spring.io/spring-boot-data-geode-build/current/reference/html5/#cloudfoundry-cloudcache-security-auth-runtime-user-configuration. – John Blum Feb 07 '22 at 18:23
  • Finally, you can always set the SDG defined properties for authentication, which are `spring.data.gemfire.security.username` and `spring.data.gemfire.security.password` in _Spring Boot_ `application.properties`, but agin, the settings must correspond to a valid, existing (configured) user when the PCC service instance was created. In fact, this is precisely what SBDG _auto-configuration_ does when it detects the _Spring Boot_ app had been deployed (pushed) to PCF and bound to a PCC service instance. ... – John Blum Feb 07 '22 at 18:26
  • It simply extracts the auth credentials from the PCF (VCAP) environment for you and sets the necessary SDG security username/password properties. – John Blum Feb 07 '22 at 18:26