2

I am working on Gemfire and Spring data caching. I have successfully startup a local cache server from Spring. But I could not connect to a remote cache server with following configuration. But I can connect remote server using Gfsh--> connect --locator = remoter IP[10334]

<gfe:client-cache   id="client-cache"   pool-name="my-pool">
</gfe:client-cache>

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

<gfe:client-region id="Customer" name="Customer" cache-ref="client-cache">
    <gfe:cache-listener>
        <bean   class="com.demo.util.LoggingCacheListener"  />
    </gfe:cache-listener>
</gfe:client-region>

<bean   id="cacheManager"
    class="org.springframework.data.gemfire.support.GemfireCacheManager">
    <property   name="regions">
        <set>
            <ref bean="Customer" />
        </set>
    </property>
</bean>  

The issue log is "Unable to prefill pool to minimum because: com.gemstone.gemfire.cache.client.NoAvailableLocatorsException: Unable to connect to any locators in the list [remoeserver:10334]"

After I started another locator and server on my desktop, Spring can connect the cluster. But it said the region did not exist when Spring @Cachable is fired. The error log is Request processing failed; nested exception is "Region named /Customer/Customer was not found during get request". The region name should be /Customer.

Napo
  • 263
  • 4
  • 14

1 Answers1

1

A client region is merely a proxy to a master region (e.g., partitioned or replicated region) configured on a cache server. The server must also be configured use the same locator address.

dturanski
  • 1,723
  • 1
  • 13
  • 8
  • Yes, it can be connected after start a locator and server on my desktop. The locator joined the cluster with the remote locator. I can put a key using GFSH successfully. However, I do not understand why it search /Customer/Customer region rather than /Customer region in Spring. – Napo Jul 29 '14 at 01:21