我创建了一个测试 gemfire 服务器。
gfsh>start locator --name=test --bind-address=localhost --port=40404
我的Java代码是:
ClientCacheFactory cf = new ClientCacheFactory().addPoolServer( "localhost", 40404);
ClientCache cache = cf.setPdxReadSerialized( true).create();
ClientRegionFactory rf = cache.createClientRegionFactory(ClientRegionShortcut.PROXY);
Region region = rf.create( "People");
但我尝试运行,它没有连接 gemfire 定位器。我不知道怎么办?
[warn 2017/07/02 06:53:51.363 HKT <poolTimer-DEFAULT-2> tid=0x17] Could not connect to: localhost:40404
java.io.EOFException
at java.io.DataInputStream.readByte(DataInputStream.java:267)
at com.gemstone.gemfire.internal.cache.tier.sockets.HandShake.greet(HandShake.java:1291)
at com.gemstone.gemfire.cache.client.internal.ConnectionImpl.connect(ConnectionImpl.java:111)
at com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:134)
at com.gemstone.gemfire.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:252)
at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.prefillConnection(ConnectionManagerImpl.java:794)
at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl.prefill(ConnectionManagerImpl.java:737)
at com.gemstone.gemfire.cache.client.internal.pooling.ConnectionManagerImpl$PrefillConnectionsTask.run2(ConnectionManagerImpl.java:888)
at com.gemstone.gemfire.cache.client.internal.PoolImpl$PoolTask.run(PoolImpl.java:1260)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
[info 2017/07/02 06:53:51.421 HKT tid=0xc] VM 正在退出 - 关闭分布式系统
[信息 2017/07/02 06:53:51.422 HKT tid=0xc] GemFireCache[id = 915500720; isClosing = true; isShutDownAll = 假;关闭GatewayHubsByShutdownAll = false; 创建 = Sun Jul 02 06:53:51 HKT 2017;服务器=假;复制阅读 = 假;锁定租赁 = 120; lockTimeout = 60]:现在关闭。
[info 2017/07/02 06:53:51.436 HKT tid=0xc] 在池 PS Old Gen 上重置原始 MemoryPoolMXBean 堆阈值字节 0
[info 2017/07/02 06:53:51.467 HKT tid=0xc] 销毁连接池默认