简体   繁体   English

获取cassandra连接错误

[英]Getting cassandra connection error

I am unable to connect to Cassandra (ver2.0.5) using Eclipse. 我无法使用Eclipse连接到Cassandra(ver2.0.5)。 Here is the complete log from the error: 以下是错误的完整日志:

16:06:59.818 [main] WARN cddriver.core.FrameCompressor - Cannot find Snappy class, you should make sure the Snappy library is in the classpath if you intend to use it. 16:06:59.818 [main] WARN cddriver.core.FrameCompressor - 找不到Snappy类,如果打算使用它,应该确保Snappy库在类路径中。 Snappy compression will not be available for the protocol. Snappy压缩将无法用于该协议。

[...] omitted for brevity [...]为简洁而省略

Use maven to import snappy/lz4 or whatever other compression your using. 使用maven导入snappy / lz4或您使用的任何其他压缩。

LZ4 LZ4

Snappy 瞬间

I just hit the same problems, seems due to some update of the libs. 我刚刚遇到同样的问题,似乎是由于libs的一些更新。 Here is my solution, by adding these dependencies in the POM.xml. 这是我的解决方案,通过在POM.xml中添加这些依赖项。

groupid/ artifactId/version: groupid / artifactId / version:

  • com.datastax.cassandra cassandra-driver-core 2.1.0 com.datastax.cassandra cassandra-driver-core 2.1.0
  • com.google.guava guava 16.0.1 io.netty netty 3.9.0.Final com.google.guava guava 16.0.1 io.netty netty 3.9.0.Final
  • com.codahale.metrics metrics-core 3.0.2 com.codahale.metrics metrics-core 3.0.2
  • org.slf4j slf4j-api 1.7.5 org.slf4j slf4j-api 1.7.5
  • org.slf4j slf4j-simple 1.6.1 org.slf4j slf4j-simple 1.6.1
  • net.jpountz.lz4 lz4 1.2.0 net.jpountz.lz4 lz4 1.2.0
  • org.xerial.snappy snappy-java 1.1.1.3 org.xerial.snappy snappy-java 1.1.1.3

The last 3 are not mentioned in the Datastax user manual but reminded in the compiling process. 最后3个未在Datastax用户手册中提及,但在编译过程中提醒。 Just try! 你试一试!

You are missing files from your class path. 您缺少类路径中的文件。 Depending on which driver you are using, you need to ensure you are including all dependent JAR files. 根据您使用的驱动程序,您需要确保包含所有相关的JAR文件。

Tthe Datastax 2.0 driver has less dependencies, the 1.x series has more. Datastax 2.0驱动程序具有较少的依赖性,1.x系列具有更多依赖性。 1.x depends on basically all the cassandra jar files. 1.x基本上取决于所有cassandra jar文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM