1
votes

I have a gemfire cluster with version 8.1.0 running with two servers and a locator.Using Pulse UI Application I can see the cluster is up and running.

From my laptop I am able to ping the ip of the RHEL unix box where the cluster is running.

Also I am able to successfully connect to the cluster using gfsh command from my laptop:

gfsh>connect --locator=locator-ip[15101]`

But I try to connect to the cluster from a client spring application(using spring data gemfire 1.5.0.RELEASE) running in my laptop using below spring data gemfire cache xml:

The client cache xml is as below:

<gfe:pool id="gemfire-pool" subscription-enabled="true" >
        <gfe:locator host="locator-ip" port="locator-port"/>
</gfe:pool>

But I am getting below exception:

com.gemstone.gemfire.cache.client.NoAvailableLocatorsException: Unable to connect to any locators in the list [locator-host:15101, locator-ip/locator-ip:15101]
    at com.gemstone.gemfire.cache.client.internal.AutoConnectionSourceImpl.findServer(AutoConnectionSourceImpl.java:136)
    at com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:206)
    at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.borrowConnection(ConnectionManagerImpl.java:214)

A simillar question has been posted

Gemfire client server topology throws NoAvailableLocatorsException

But the above error is in a different method in ConnectionManagerImpl class.

EDIT: The cache xml has below client-cache declaration:

<util:properties id="gemfire-props">
        <prop key="log-level">error</prop>
</util:properties>

<gfe:client-cache id="gemfireCache" pool-name="gemfire-pool" properties-ref="gemfire-props">

<gfe:client-region id="skuInfoRegionBean" pool-name="gemfire-pool"
        name="SKU_INFO" shortcut="CACHING_PROXY">
</gfe:client-region>
2

2 Answers

1
votes

What version of Spring Data GemFire and GemFire are you running? Also, if you could share your Spring config configuring the GemFire ClientCache (& Pool) connecting to your cluster running the RHEL server(s), that would be helpful.

My understanding is that your cluster is running on the "remote" RHEL UNIX machine(s) and your client is running from your laptop, correct?

Based on your Gfsh connect command syntax, your Spring config would need to look similar to...

<gfe:pool ...>
  <gfe:locator host="locator-ip" port="15101"/>
</gfe:pool>

<gfe:client-cache/>

...

The NoAvailableLocatorsException message seems peculiar... "Unable to connect to any locators in the list [locator-host:15101, locator-ip/locator-ip:15101]" and not quite correct.

0
votes

It was a network issue.It works when I try from office but does not work from home via vpn.