不支持的带有 Amazon Keyspaces 的分区器(适用于 Apache Cassandra) [英] Unsupported partitioner with Amazon Keyspaces (for Apache Cassandra)
问题描述
我有一个 Java Spring 应用程序,我正在使用
使用Spring boot 2.3.x版本
时遇到的上述问题因为是 Spring 启动版本 2.3.x
<依赖><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-cassandra-reactive</artifactId></依赖>或者<依赖><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-data-cassandra</artifactId></依赖>
创建 Maven/Gradle 时将获得 datastax-java-driver-core 4.6.1",我认为这是 不支持 Amazon Keyspaces 的另一个原因.强>
<块引用>好的,清楚.....
回到 AWS 库的主题 aws-sigv4-auth-cassandra-java-driver-plugin 4.0.2
创建 Maven/Gradle 时会得到 datastax-java-driver-core 4.4.0"
现在我开始看到 Amazon Keyspaces
可能不支持 datastax-java-driver-core" 版本高于 4.4.0
<块引用><块引用>好的,已经很久了.
<块引用><块引用>
如果你想让 Application Spring Boot 2 工作
您尝试遵循以下解决方案.
查看pom.xml
删除aws-sigv4-auth-cassandra-java-driver-plugin
将 Spring Boot 版本 2.3.x 降级到 2.2.9
在下面添加依赖,
spring-boot-starter-data-cassandra-reactive或者spring-boot-starter-data-cassandra
创建亚马逊数字证书并下载
如果您使用了 InteljiJ IDEA 编辑配置
转到编辑配置 ->下一个 VM 选项在下面添加,
-Djavax.net.ssl.trustStore=path_to_file/cassandra_truststore.jks-Djavax.net.ssl.trustStorePassword=my_password
参考:
<块引用>通过.
为我工作.
技术栈
- Spring Boot WebFlux 2.2.9.RELEASE
- Cassandra 反应式
- JDK 13
- 使用 Amazon Keyspaces 的 Cassandra 数据库
- Maven 3.6.3
享受编程的乐趣.
I have a Java Spring app and I'm using Amazon Keyspaces (for Apache Cassandra). I'm using the sigv4 plugin , (version 4.0.2), the cassandra java-driver-core (version 4.4.0) and have followed the official documentation on how to connect my java app with MCS. The app connects just fine but I'm getting a weird warning at start up:
WARN 1 --- [ s0-admin-0] .o.d.i.c.m.t.DefaultTokenFactoryRegistry : [s0] Unsupported partitioner 'com.amazonaws.cassandra.DefaultPartitioner', token map will be empty.
Everything looks good but after a few minutes that warning comes back and my queries start to fail. This is how the logs look after a few minutes:
WARN 1 --- [ s0-admin-0] .o.d.i.c.m.t.DefaultTokenFactoryRegistry : [s0] Unsupported partitioner 'com.amazonaws.cassandra.DefaultPartitioner', token map will be empty.
WARN 1 --- [ s0-io-1] c.d.o.d.i.c.m.SchemaAgreementChecker : [s0] Unknown peer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, excluding from schema agreement check
WARN 1 --- [ s0-io-0] c.d.o.d.i.c.control.ControlConnection : [s0] Unexpected error while refreshing schema after a successful reconnection, keeping previous version (CompletionException: com.datastax.oss.driver.api.core.connection.ClosedConnectionException: Channel was force-closed)
WARN 1 --- [ s0-io-1] c.d.o.d.i.c.m.DefaultTopologyMonitor : [s0] Control node ec2-x-xx-xxx-xx.us-east-2.compute.amazonaws.com/x.xx.xxx.xxx:xxxx has an entry for itself in system.peers: this entry will be ignored. This is likely due to a misconfiguration; please verify your rpc_address configuration in cassandra.yaml on all nodes in your cluster.
I have debugged a little and it looks like that partitioner comes from the actual node metadata, so I don't really know if there's an actual way to fix it.
I've seen there's a similar question asked recently here, but no solution has been posted yet. Any ideas? Thanks so much in advance
Problem the same with me.
The above problems encountered when using a Spring boot version 2.3.x
Because is a Spring boot version 2.3.x
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra-reactive</artifactId>
</dependency>
OR
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-cassandra</artifactId>
</dependency>
When creating a Maven / Gradle will get "datastax-java-driver-core 4.6.1" and I think this is another reason that Amazon Keyspaces are not supported.
Okay, Clear.....
Back to the subject of AWS library aws-sigv4-auth-cassandra-java-driver-plugin 4.0.2
When creating a Maven / Gradle will get "datastax-java-driver-core 4.4.0"
Now I am starting to see that Amazon Keyspaces
Maybe not supported "datastax-java-driver-core" with version greater than 4.4.0
Okay, it's been very long.
If you want Application Spring Boot 2 to work
You try following the solutions follows.
look at pom.xml
remove aws-sigv4-auth-cassandra-java-driver-plugin
downgrade Spring boot version 2.3.x to 2.2.9
add dependency below,
spring-boot-starter-data-cassandra-reactive OR spring-boot-starter-data-cassandra
create Amazon digital certificate and download
If you used InteljiJ IDEA Edit Configurations
Goto Edit Configurations -> next VM Options add below,
-Djavax.net.ssl.trustStore=path_to_file/cassandra_truststore.jks
-Djavax.net.ssl.trustStorePassword=my_password
Reference: https://docs.aws.amazon.com/keyspaces/latest/devguide/using_java_driver.html
- application-dev.yml add config below,
spring:
data:
cassandra:
contact-points:
- "cassandra.ap-southeast-1.amazonaws.com"
port: 9142
ssl: true
username: "cassandra-username"
password: "cassandra-password"
keyspace-name: keyspace-name
request:
consistency: local_quorum
- Run Test Program
Pass.
Work for me.
Tech Stack
- Spring Boot WebFlux 2.2.9.RELEASE
- Cassandra Reactive
- JDK 13
- Cassandra Database with Amazon Keyspaces
- Maven 3.6.3
Have fun with programming.
这篇关于不支持的带有 Amazon Keyspaces 的分区器(适用于 Apache Cassandra)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!