英文:
geode client server version not supported - Peer or client version with ordinal 100 not supported
问题
I've a springboot app hosted on PCF trying to connect to PCC(pivotal cloud cache). I've spinned up a PCC instance and binded it to my app and pushed the app to cloud foundry. I've added all the required gemfire starter dependencies to springboot and it appears like it was able to read the locator and server information from VCAP_SERVICES. But, I see the following error on spring boot app startup.
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!/:?]
I'm not sure what ordinals means here and also what dependencies need to be updated.
Here are my maven dependencies..
<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>
This is my config file..
@Configuration
@ClientCacheApplication(name = "Test", logLevel = "info")
@EnableCachingDefinedRegions(
clientRegionShortcut = ClientRegionShortcut.PROXY,
serverRegionShortcut = RegionShortcut.REPLICATE_HEAP_LRU)
@EnableClusterAware
@EnablePdx
public class CloudConfiguration {}
Any help?
英文:
I've a springboot app hosted on PCF trying to connect to PCC(pivotal cloud cache). I've spinned up a PCC instance and binded it to my app and pushed the app to cloud foundry. I've added all the required gemfire starter dependencies to springboot and it appears like it was able to read the locator and server information from VCAP_SERVICES. But, I see the following error on spring boot app startup.
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!/:?]
I'm not sure what ordinals means here and also what dependencies need to be updated.
Here are my maven dependencies..
<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>
This is my config file..
@Configuration
@ClientCacheApplication(name = "Test", logLevel = "info")
@EnableCachingDefinedRegions(
clientRegionShortcut = ClientRegionShortcut.PROXY,
serverRegionShortcut = RegionShortcut.REPLICATE_HEAP_LRU)
@EnableClusterAware
@EnablePdx
public class CloudConfiguration {}
Any help?
答案1
得分: 2
尽管您自己解决了问题,并且在问题的要点上也有所了解,但我想在这里提供一些更详细的信息(供有兴趣的读者参考),并提供一些指导。
让我们从头开始:
首先,您的应用程序依赖项,如上面的Maven POM中所示,非常混乱!
您在声明直接的“有版本号的”依赖项时,Spring Data GemFire(即org.springframework.data:spring-data-gemfire:2.2.1.RELEASE
)以及Spring Data Geode(即org.springframework.data:spring-data-geode:2.2.6.RELEASE
,这两者不匹配;SD GemFire 2.2.1 != SD Geode 2.2.6),还有Spring Boot for Apache Geode & Pivotal GemFire(SBDG)(org.springframework.geode:spring-geode-starter:1.2.6.RELEASE
),然后不必要地引入了SBDG的spring-geode
(核心)模块,这个模块会被spring-geode-starter
自动引入,此外还声明了org.apache.geode:geode-core
模块,呼哧!:)
在这种情况下,您只需要声明一个SBDG的starter依赖项,无论是使用Apache Geode的org.springframework.geode:spring-geode-starter
还是使用Pivotal GemFire的org.springframework.geode:spring-gemfire-starter
,或者在将您的Spring Boot应用程序部署到PCF并使用PCC时(在这种情况下,建议使用spring-gemfire-starter
依赖项,尽管并不是绝对必要的,因为可以混合使用GemFire/Geode peers,并且可以让Geode客户端与GemFire服务器进行通信,反之亦然)。
这个starter会引入Spring Data Geode(或Spring Data GemFire,取决于starter)以为您引入Geode(或GemFire)相关的内容。这正是Maven/Gradle依赖管理的目的,首先最好尽可能地减少应用程序依赖的声明,只需让框架/启动器为您决定传递依赖项的版本,特别是如果您不关心版本。
总的来说,Spring Boot项目会在这里对所有依赖版本(包括Spring和第三方库/传递依赖项)进行精心协调和调和。您只需要根据所需的应用程序依赖版本(如Apache Geode或Pivotal GemFire)选择Spring Boot的版本。
我们在这里为您总结了这些信息:
具体来说,可以看到:
为了非常透明,这个版本兼容性矩阵/表大致翻译为:
- 作为开发者,我正在使用或选择使用SBDG
1.2.6.RELEASE
。 - SBDG
1.2.6.RELEASE
是基于Spring Boot2.2.6.RELEASE
的。 - Spring Boot
2.2.6.RELEASE
引入了Spring DataMoore-SR6
。 - Spring Data
Moore-SR6
(此处)包含了Spring Data GemFire/Geode2.2.6.RELEASE
。 - Spring Data Geode(SDG)
Moore-SR6/2.2.6.RELEASE
是基于Apache Geode1.9.x
的。 - Spring Data GemFire(SDG)
Moore-SR6/2.2.6.RELEASE
是基于Pivotal GemFire9.8.x
的。 - Spring Data Geode包含所需的(由SDG提供的)和正确的Apache Geode位(依赖项)。
- Spring Data GemFire包含所需的(由SDG提供的)和正确的Pivotal GemFire位(依赖项)。
因此,问题变成了,您需要在PCF中的PCC上使用哪个版本的SBDG(即spring-[geode|gemfire]-starter
版本)?
为此,您必须对GemFire/Geode客户端只能连接并与GemFire/Geode服务器在相同版本或更新版本上进行通信有一个一般的理解。更新的客户端不能与较旧的GemFire/Geode服务器进行通信。这不是Spring的限制,而是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或更早的服务器进行通信。记住,补丁或维护版本无关紧要,意味着GemFire 9.8.7客户端应该能够连接并与GemFire 9.8.4服务器进行通信,只要`
英文:
Though you solved your issue yourself and sort of got to the gist of the problem, I wanted to provide a bit more detail here (for interested readers), as well as provide some guidance.
Let's start from the beginning:
First, your application dependencies, as shown in the Maven POM above, are very confused!
You are declaring direct, "versioned" dependencies on Spring Data GemFire (i.e. org.springframework.data:spring-data-gemfire:2.2.1.RELEASE
) along with Spring Data Geode (i.e. org.springframework.data:spring-data-geode:2.2.6.RELEASE
, which do not match; SD GemFire 2.2.1 != SD Geode 2.2.6) along with Spring Boot for Apache Geode & Pivotal GemFire (SBDG) (org.springframework.geode:spring-geode-starter:1.2.6.RELEASE
), and then unnecessarily pull in SBDG's spring-geode
(core) module, which would be transitively pulled in by the spring-geode-starter
anyway, as well as declaring the org.apache.geode:geode-core
module, phew!
The only dependency you need to declare in this case is 1 of SBDG's starters, either org.springframework.geode:spring-geode-starter
when using Apache Geode or org.springframework.geode:spring-gemfire-starter
when using Pivotal GemFire, or alternatively when deploying your Spring Boot application to PCF using PCC (in which case, the spring-gemfire-starter
dependency is recommended, though not absolutely necessary since it is possible to mix GemFire/Geode peers and have Geode clients talk to GemFire serves or vice versa).
The starter pulls in Spring Data Geode (or Spring Data GemFire, depending on the starter) which pulls in the Geode (or GemFire) bits for you. That is the point of Maven/Gradle dependency management in the first place and it is better to minimize your application dependency declarations as much as possible and just let the framework/starter decide the versions of the transitive dependencies for you, especially if you don't care.
The Spring Boot project in general goes to great lengths to curate and harmonize all the dependency versions (both Spring and 3rd party libs/transitive dependencies included) for you. You only need to choose the version of the Spring Boot based on the versions of the application dependencies (e.g. Apache Geode or Pivotal GemFire) that you require.
We try to summarize those for you here:
Specifically, see:
To be very transparent, this version compatibility matrix/table, roughly translates into:
- As a developer, I am using or choosing to use SBDG
1.2.6.RELEASE
. - SBDG
1.2.6.RELEASE
is based on Spring Boot2.2.6.RELEASE
. - Spring Boot
2.2.6.RELEASE
pulls in Spring DataMoore-SR6
. - Spring Data
Moore-SR6
(this) includes Spring Data GemFire/Geode2.2.6.RELEASE
. - Spring Data Geode (SDG)
Moore-SR6/2.2.6.RELEASE
is based on Apache Geode1.9.x
. - Spring Data GemFire (SDG)
Moore-SR6/2.2.6.RELEASE
is based on Pivotal GemFire9.8.x
. - Spring Data Geode includes the required (by SDG) and correct Apache Geode bits (dependencies).
- Spring Data GemFire includes the required (by SDG) and correct Pivotal GemFire bits (dependencies).
Therefore it becomes a matter of what version of SBDG (i.e. which spring-[geode|gemfire]-starter
version) do you need to use with PCC in PCF?
For that, you must have a general understanding that GemFire/Geode clients can only connect to and communicate with GemFire/Geode servers at the same version as the client or later. A newer client CANNOT talk to an older GemFire/Geode server. This is not a Spring restriction, but a GemFire/Geode restriction itself. There are many factors to why this is the case and I won't explain that here (but it roughly boils down to protocols, distributed algorithms and the rest).
By way of example, you can connect a GemFire 9.8 client to a GemFire 9.8.x server and all will be fine. That same GemFire 9.8 client can also connect to and talk with GeFire 9.9.x and 9.10.x servers. However, a GemFire 9.8 client cannot connect to or talk with a GemFire 9.7, 9.6, 9.5 or earlier server. Patch, or maintenance versions do not matter AFAIR, meaning a GemFire 9.8.7 client should be able to connect and talk to a GemFire 9.8.4 server, for example, so long as the major.minor
versions match.
So now, it essentially boils down to, which version of Pivotal GemFire is the version of PCC in PCF that you are deploying your Spring Boot (Data Geode) application to, based on?
For that you need to look in the PCF/PCC documentation.
For example, PCC for PCF (now known as VMware Tanzue GemFire for VMs) version 1.11 is based on Pivotal GemFire 9.9.1. See here.
This means you could use SBDG 1.2.6.RELEASE
, which is based on Spring Boot 2.2.6.RELEASE
, which pulls in Spring Data Moore-SR6
, which includes SDG 2.2.6.RELEASE
, which is based on Apache Geode 1.9.2
/Pivotal GemFire 9.8.7
. This combination is fine because the older client (i.e. GemFire 9.8.7
) can connect to and talk with GemFire 9.9.1
, which is the baseline for PCC/VMware Tanzu GemFire for VMS 1.11
.
Make sense?
If we look at PCC 1.10, again that is based on Pivotal GemFire 9.9.1.
If we look at PCC 1.9, it is based on Pivotal GemFire 9.8.6. Again, we are ok here.
If we go back to PCC 1.7, we see that PCC 1.7 was based on Pivotal GemFire 9.7.2.
Now, SBDG 1.2.6.RELEASE
will NOT work with PCC 1.7 since SBDG 1.2.6.RELEASE
is based on GemFire 9.8 (newer) and PCC 1.7 is based on GemFire 9.7 (older). A 9.8 client cannot connect to and talk with a 9.7 server, therefore, we must go back a SBDG major.minor
version to SBDG 1.1.x
, where SBDG 1.1.x
is based on Spring Boot 2.1
, which pulls in Spring Data Lovelace/2.1
, which includes SDG 2.1.x
, which is based on Apache Geode 1.6
and Pivotal GemFire 9.5
, respectively.
NOTE: While SDG is "compatible" with newer, none "baseline" versions of GemFire/Geode, we do not "support" the combination. For example, SDG Lovelace/2.1 is "based on" GemFire 9.5/Geode 1.6 only, but is "compatible with" GemFire 9.6/9.7 and Geode 1.7/1.8. If you move beyond GemFire 9.7 to, e.g. 9.8 and Geode 1.8 to 1.9, then of course, you should move to SDG Moore/2.2, since it is "based on" GemFire 9.8/Geode 1.9. Compatibility != Support.
Anyway, this is to say, you can upgrade your client driver version (i.e. GemFire/Geode client version, if necessary). See here for more details. This Wiki page is a WIP.
The Cloud Cache Developer Website also contains details to help get you started.
Finally, I also built this Getting Started Sample (with Guide and Source Code) in the SBDG project itself, that gets you up and running quickly by starting at start.spring.io.
Now, regarding your configuration...
@Configuration
@ClientCacheApplication(name = "Test", logLevel = "info")
@EnableCachingDefinedRegions(
clientRegionShortcut = ClientRegionShortcut.PROXY,
serverRegionShortcut = RegionShortcut.REPLICATE_HEAP_LRU)
@EnableClusterAware
@EnablePdx
public class CloudConfiguration {}
This can be simplified to:
@Configuration
@EnableCachingDefinedRegions(
serverRegionShortcut = RegionShortcut.REPLICATE_HEAP_LRU
)
@EnableClusterAware
public class CloudConfiguration {}
SBDG "auto-configures" a ClientCache
instance for you, by default. See here.
In fact, you should be careful when declaring annotations, explicitly, since then you are overriding the auto-configuration (i.e. you are overriding the "convention" by applying explicit "configuration", which tells Boot that you know what you are doing; Make sure that is actually the case!) See here and here and here and here and here.
Many of the annotation attributes (e.g. ClientCacheApplication.name
or ClientCacheApplication.logLevel
) can be expressed as SDG properties in a Spring Boot applications.properties
file, making the configuration more "configurable".
For example:
# Spring Boot application.properties.
spring.data.gemfire.name=Test
spring.data.gmefire.cache.log-level=INFO
See here and here for more details.
You also do not need to enable PDX explicitly since again SBDG auto-configures PDX for you. See here.
The default ClientRegionShortcut
is PROXY, though I don't mind being "explicit" about it either. You simply just have to be careful in a Spring Boot context with auto-configuration since you might "override" the auto-config and put the responsibility of managing the configuration correctly on yourself. So declare configuration with intent, not blindly.
Hope this helps!
答案2
得分: 1
解决方案:我将SpringBoot客户端版本降级为v1.7,然后它正常工作了。不过,我现在看到有身份验证问题。
英文:
Solution: I downgraded the SpringBoot client version to v1.7 and it worked fine. Although, I see authentication issue now.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论