我有一个客户端/服务器拓扑方案。
在本地运行一个 Locator 和两台服务器的简单集群,不同的 JVM 进程,服务器在启动时没有创建区域,配置如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<util:properties id="gemfireProperties">
<prop key="name">${gemfire.server.name}</prop>
<prop key="mcast-port">${gemfire.server.mcast-port}</prop>
<prop key="log-level">${gemfire.server.log-level}</prop>
<prop key="locators">${gemfire.server.locators}</prop>
</util:properties>
<gfe:cache properties-ref="gemfireProperties" use-cluster-configuration="true"/>
<gfe:cache-server auto-startup="true" bind-address="${gemfire.server.bind-address}"
host-name-for-clients="${gemfire.server.hostname-for-clients}"
port="${gemfire.server.port}"
max-connections="${gemfire.server.max-connections}"/>
然后,我正在运行具有以下配置的客户端:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gfe="http://www.springframework.org/schema/gemfire"
xsi:schemaLocation="http://www.springframework.org/schema/gemfire http://www.springframework.org/schema/gemfire/spring-gemfire.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<beans>
<gfe:client-cache id="gemfireClientCache" pool-name="gemfireConnectionPool" ready-for-events="true"/>
<gfe:pool id="gemfireConnectionPool" subscription-enabled="true">
<gfe:locator host="localhost" port="10334"/>
</gfe:pool>
<gfe:client-region id="MYREGION"
shortcut="PROXY"
key-constraint="java.lang.String"
value-constraint="MYPOJO"
cache-ref="gemfireClientCache"
pool-name="gemfireConnectionPool"/>
</beans>
Spring Boot 应用程序启动时没有任何问题,但我发现以下日志很奇怪:
[info 2017/01/05 20:37:56.103 WET <main> tid=0x1] Running in local mode since mcast-port was 0 and locators was empty.
虽然我可以在 Pulse 中看到所有集群成员,但服务器没有“MYREGION”区域。所以,我想知道,缓存客户端可以实际在服务器上创建区域还是只能“使用”现有区域?
Pivotal 文档确实有一个“动态创建区域”部分,但我还没有这样做,因为我失去了分区。
谢谢