1

我们有一个 Spring Mvc 应用程序(客户端),它连接到两个不同的 Gemfire 分布式系统并通过 REST 服务公开数据;在引导 Spring Mvc 应用程序时,我们遇到一个异常,它无法连接到两个分布式系统;我们在配置中定义了两个客户端缓存,这会导致问题,但我们需要连接到两个分布式系统。我们如何解决这个错误?我们在导致问题的 servlet xml 中定义了两个客户端缓存标记;

4

1 回答 1

0

本质上,GemFireDistributedSystemClientCacheJVM 进程中的都是单例,并且不可能在同一个 JVM 中有 2 个不同的客户端缓存具有显着不同的DistributedSystem配置。

我听说客户使用连接到 2 个不同 GemFire 集群(即DistributedSystems)的单个客户端缓存,但我不确定这是否真的被推荐。

您可以尝试以下方法。假设你有两个集群......

Cluster 1: Locator A, Server B, Server C

Cluster 2: Locator Z, Server X, Server Y.

然后,您也许可以像这样创建具有 2 个池的单个缓存...

<gfe:client-cache/>

<gfe:pool id="clusterOnePool" ... >
  <gfe:locator host="LocatorA-Host/IP" port="LocatorA-Port"/>
</gfe:pool>

<gfe:pool id="clusterTwoPool" ...>
  <gfe:locator host="LocatorZ-Host/IP" port="LocatorZ-Port"/>
</gfe:pool>

<gfe:client-region id="RegionInClusterOne" shortcut="[PROXY|CACHING_PROXY]"
                   pool-name="clusterOnePool">
  ...
</gfe:client-region>

<gfe:client-region id="RegionInClusterTwo" shortcut="[PROXY|CACHING_PROXY]"
                   pool-name="clusterTwoPool">
  ...
</gfe:client-region>

我不确定这是否有效,但也许。另外,我也不确定这是否真的被推荐。

让客户端连接到 2 个不同集群的 UC 是什么?

于 2016-03-21T18:54:31.183 回答