クライアント/サーバー トポロジのシナリオがあります。
1 つの Locator と 2 つのサーバーの単純なクラスターをローカルで実行し、異なる 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 のドキュメントには「動的にリージョンを作成する」というセクションがありますが、パーティショニングが失われるため、まだその方法には行きません。
ありがとう