Java 不支持geode客户端服务器版本-不支持序号为100的对等或客户端版本
我有一个springboot应用程序托管在PCF上,试图连接到PCC(关键云缓存)。我已经启动了一个PCC实例,并将其绑定到我的应用程序,并将该应用程序推送到cloud foundry。我已经向springboot添加了所有必需的gemfire starter依赖项,它似乎能够从VCAP_服务读取定位器和服务器信息。但是,我在spring boot应用程序启动时看到以下错误Java 不支持geode客户端服务器版本-不支持序号为100的对等或客户端版本,java,gemfire,geode,spring-data-gemfire,spring-boot-data-geode,Java,Gemfire,Geode,Spring Data Gemfire,Spring Boot Data Geode,我有一个springboot应用程序托管在PCF上,试图连接到PCC(关键云缓存)。我已经启动了一个PCC实例,并将其绑定到我的应用程序,并将该应用程序推送到cloud foundry。我已经向springboot添加了所有必需的gemfire starter依赖项,它似乎能够从VCAP_服务读取定位器和服务器信息。但是,我在spring boot应用程序启动时看到以下错误 org.apache.geode.cache.client.internal.ConnectionFactoryImpl.
org.apache.geode.cache.client.internal.ConnectionFactoryImpl.createClientToServerConnection(ConnectionFactoryImpl.java:120) - Could not create a new connection to server: XXX.XXX.XX.XXX(cacheserver-c3a291d1-9664-40d5-b20c-ad8dca8cd19e:1)<v3>:56152(version:GEODE 1.7.0) refused connection:
Peer or client version with ordinal 100 not supported. Highest known version is 1.7.0 Client: /XXX.XXX.XX.XXX:39192.
at org.apache.geode.internal.cache.tier.sockets.Handshake.readMessage(Handshake.java:330) ~[geode-core-1.9.2.jar!/:?]
有什么帮助吗?解决方案:我将SpringBoot客户端版本降级为v1.7,并且运行良好。不过,我现在看到了身份验证问题 解决方案:我将SpringBoot客户机版本降级为v1.7,并且运行良好。不过,我现在看到了身份验证问题 虽然您自己解决了问题,并大致了解了问题的要点,但我想在这里提供更多细节(供感兴趣的读者参考),并提供一些指导 让我们从头开始: 首先,如上面的Maven POM所示,您的应用程序依赖关系非常混乱 您正在声明Spring数据GemFire(即
org.springframework.Data:Spring数据GemFire:2.2.1.RELEASE
)与Spring数据Geode(即org.springframework.Data:Spring数据Geode:2.2.6.RELEASE
)之间的直接“版本化”依赖关系,但不匹配;SD GemFire 2.2.1!=SD Geode 2.6)与Apache Geode和Pivotal GemFire(SBDG)的Spring Boot一起(org.springframework.Geode:Spring Geode starter:1.2.6.RELEASE
),然后不必要地拉入SBDG的Spring Geode
(核心)模块,该模块将由Spring Geode starter
临时拉入,以及声明org.apache.geode:geodecore
模块,呸!:)
在本例中,您需要声明的唯一依赖项是SBDG的一个启动器,当使用ApacheGeode时为org.springframework.geode:spring-geode-starter
,当使用Pivotal gemfire时为org.springframework.geode:spring-gemfire-starter
,或者当使用PCC将spring-Boot应用程序部署到PCF时为SBDG(在这种情况下,建议使用spring-gemfire-starter
依赖项,但这并不是绝对必要的,因为可以混合使用gemfire/Geode对等项,让Geode客户端与gemfire服务进行对话,反之亦然)
启动器拉入弹簧数据Geode(或弹簧数据GemFire,取决于启动器),后者拉入Geode(或GemFire)首先,这是Maven/Gradle依赖关系管理的要点,最好尽可能减少应用程序依赖关系声明,让框架/启动程序为您决定可传递依赖关系的版本,尤其是在您不在乎的情况下
Spring Boot项目通常会为您提供大量支持(包括Spring和第三方LIB/可传递依赖项)。您只需根据所需的应用程序依赖项版本(例如Apache Geode或Pivotal GemFire)选择Spring Boot的版本
我们尝试在这里为您总结这些内容:
具体见:
为了非常透明,此版本的兼容性矩阵/表大致可转换为:
1.2.6.RELEASE
1.2.6.释放
是弹簧靴2.2.6.释放
2.2.6.释放
Spring数据Moore-SR6
Moore-SR6
()弹簧数据GemFire/Geode2.2.6.发布
Moore-SR6/2.2.6.版本
是Apache Geode1.9.x
Moore-SR6/2.2.6.版本
是GemFire9.8.x
的关键spring-[geode | gemfire]-启动器version)成为一个问题
为此,您必须了解GemFire/Geode客户端只能连接到与客户端版本相同或更高版本的GemFire/Geode服务器并与之通信。较新的客户端不能与较旧的GemFire/Geode服务器通信。这不是Spring限制,而是GemFire/Geode限制本身。有许多因素可以影响GemFire/Geode服务器这是为什么,我不会在这里解释(但它大致归结为协议、分布式算法和其他)
举例来说,您可以将GemFire 9.8客户端连接到GemFire 9.8.x服务器,一切正常。同一个GemFire 9.8客户端也可以连接到GeFire 9.9.x和9.10.x服务器并与之通信。但是,GemFire 9.8客户端无法连接到GemFire 9.7、9.6、9.5或更早版本的服务器或与之通信。修补程序或维护版本不兼容例如,在AFAIR上,这意味着GemFire 9.8.7客户端应该能够连接GemFire 9.8.4服务器并与之对话,只要major.minor
版本匹配
那么现在,它本质上归结为,哪个版本的Pivotal GemFire是您部署Spring Boot(Data Geode)应用程序所基于的PCF中的PCC版本
为此,您需要查看PCF/PCC文档
例如,PCC For PCF(现在称为VMware Tanzue GemFire For VMs)版本1.11基于关键的GemFire 9.9.1。请参阅
这意味着您可以使用SBDG1.2.6.RELEASE
,它基于Spring Boot2.2.6.RELEASE
,它可以拉入Spring数据Moore-SR6
,其中包括SDG2.2.6.RELEASE
,它基于ApacheGeode1.9.2
/GemFire9.8.7
。这种组合很好,因为
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-gemfire</artifactId>
<version>2.2.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.geode</groupId>
<artifactId>spring-geode</artifactId>
<version>1.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>io.pivotal.gemfire</groupId>
<artifactId>geode-core</artifactId>
<version>9.8.4</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-geode</artifactId>
<version>2.2.6.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.geode</groupId>
<artifactId>spring-geode-starter</artifactId>
<version>1.2.6.RELEASE</version>
</dependency>
@Configuration
@ClientCacheApplication(name = "Test", logLevel = "info")
@EnableCachingDefinedRegions(
clientRegionShortcut = ClientRegionShortcut.PROXY,
serverRegionShortcut = RegionShortcut.REPLICATE_HEAP_LRU)
@EnableClusterAware
@EnablePdx
public class CloudConfiguration {}
# Spring Boot application.properties.
spring.data.gemfire.name=Test
spring.data.gmefire.cache.log-level=INFO