Hi Gabor,

I have another question about the Kubernetes setup you’re using.  Are you 
running the Geode pods and Spring Boot application Pods in the same cluster?

How are the pods connected?  Through a Node or LoadBalancer service?

Thanks,

John

From: Jens Deppe <jde...@vmware.com>
Reply-To: "user@geode.apache.org" <user@geode.apache.org>
Date: Tuesday, September 8, 2020 at 9:57 AM
To: "user@geode.apache.org" <user@geode.apache.org>
Subject: Re: Geode REST API - Question

Hi Gábor

I’m not sure that you are hitting a bug with incorrect URLs here.

Geode has a couple of REST APIs.

One is a Developer REST API which you have enabled with the 
gemfire.start-dev-rest-api option (endpoint is: /gemfire-api/v1 or /geode/v1 – 
they are equivalent). Another is an internal Admin REST API which is used by 
gfsh when run over HTTP (endpoint is: /gemfire/v1 or /geode-mgmt/v1). It’s this 
internal API that SDG uses when you use @EnableClusterConfiguration with 
useHttp=true. This endpoint is automatically enabled on the locator when you 
start a cluster.

Something to note is that both of these REST APIs will run on the same port 
(7070) by default. If you’re wanting all the Geode components (servers and 
locators) to run on localhost you need to pick different ports for each REST 
endpoint.

Can you try your app without the gemfire.start-dev-rest-api option? Without 
this, the Developer REST API endpoint will not start (on port 7070). But SDG 
should be able to do what it needs to in terms of region creation. Remember 
also that SDG needs to communicate with the locator in your cluster.

I’m not very familiar with Kubernetes so all of the ports may well be 
completely isolated within their own containers, but you may still have some 
problem of port masking here.

--Jens

From: Gábor Kendelényi <gabor.kendele...@ericsson.com>
Reply-To: "user@geode.apache.org" <user@geode.apache.org>
Date: Tuesday, September 8, 2020 at 1:03 AM
To: "user@geode.apache.org" <user@geode.apache.org>
Subject: Geode REST API - Question

Hi Geode Team/Users,

I need your help figuring out why the Apache Geode Java Client is behaving the 
way it does.
Overall my task is simple. I just need to connect to a Geode server running in 
a small Kubernetes test cluster via a Spring Boot application.

Geode Server
On the Geode side I have enabled the REST API by setting the 
“-Dgemfire.start-dev-rest-api” property true.
It’s working properly.
bash-4.4# curl -i -X GET http://localhost:7070/gemfire-api/v1
HTTP/1.1 200 OK
Date: Mon, 07 Sep 2020 12:39:43 GMT
Location: http://localhost:7070/gemfire-api/v1

Spring Boot App
On the App side I’m using the below annotations in order I could do the region 
creation part through the client:
@ClientCacheApplication(useHttp=true)
@EnableClusterConfiguration
@EnableEntityDefinedRegions


Problem
When I check the application log during start app I can see that the client is 
trying to use a slightly different URL for the RegionCreation POST request:
org.springframework.context.ApplicationContextException: Failed to start bean 
'gemfireClusterSchemaObjectInitializer'; nested exception is 
org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not 
Found: [HTTP ERROR 404 Not Found
URI: /gemfire/v1/regions
STATUS: 404
MESSAGE: Not Found
SERVLET: null
]


So instead of “/gemfire-api/v1” or “/geode/v1” it’s trying to access the 
“/gemfire/v1” url.

Could you help me figure out why is that? Is this a bug?

Regards, Gábor

Reply via email to