简体   繁体   中英

Getting cassandra connection error

I am unable to connect to Cassandra (ver2.0.5) using Eclipse. 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. Snappy compression will not be available for the protocol.

[...] omitted for brevity

Use maven to import snappy/lz4 or whatever other compression your using.

LZ4

Snappy

I just hit the same problems, seems due to some update of the libs. Here is my solution, by adding these dependencies in the POM.xml.

groupid/ artifactId/version:

  • com.datastax.cassandra cassandra-driver-core 2.1.0
  • com.google.guava guava 16.0.1 io.netty netty 3.9.0.Final
  • com.codahale.metrics metrics-core 3.0.2
  • org.slf4j slf4j-api 1.7.5
  • org.slf4j slf4j-simple 1.6.1
  • net.jpountz.lz4 lz4 1.2.0
  • 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. 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.

Tthe Datastax 2.0 driver has less dependencies, the 1.x series has more. 1.x depends on basically all the cassandra jar files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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