无法使用Spark cassandra连接器1.5.0连接Cassandra 3.0

时间:2016-04-27 13:28:52

标签: java amazon-web-services cassandra-2.0 spark-cassandra-connector

问题 - 无法使用Spark Cassandra连接器1.5.0连接Cassandra 3.0

背景 - 我尝试使用Spark 1.5.0连接Cassandra 3.0 通过使用提供的Spark cassandra连接器1.5.0但我收到以下错误 -

根据DataStax Spark Cassandra Connector document,它表示Spark连接器1.5可以用于Spark 1.5.0 / 1.6.0中的Cassandra 3.0。

你能否建议我,我在这里错过任何一步?

尝试方法

  1. 我试图从Spark流媒体和核心jar

  2. 中排除Guava依赖
  3. 在" pom.xml"

  4. 中添加了单独的Guava依赖项

    提前致谢。

    16/04/26 09:45:07 WARN TaskSetManager: Lost task 4.0 in stage 1.0 (TID 16, ip-172-31-23-23.ec2.internal): java.lang.ExceptionInInitializerError
        at  com.datastax.spark.connector.cql.DefaultConnectionFactory$.clusterBuilder(CassandraConnectionFactory.scala:35)
        at com.datastax.spark.connector.cql.DefaultConnectionFactory$.createCluster(CassandraConnectionFactory.scala:87)
        at 
    ---
    --
    Caused by: java.lang.IllegalStateException: Detected Guava issue #1635 which indicates that a version of Guava less than 16.01 is in use.  This introduces codec resolution issues and potentially other incompatibility issues in the driver.  Please upgrade to Guava 16.01 or later.
        at com.datastax.driver.core.SanityChecks.checkGuava(SanityChecks.java:62)
        at com.datastax.driver.core.SanityChecks.check(SanityChecks.java:36)
        at com.datastax.driver.core.Cluster.<clinit>(Cluster.java:67)
        ... 23 more16/04/26 09:45:07 WARN TaskSetManager: Lost task 4.0 in stage 1.0 (TID 16, ip-172-31-23-23.ec2.internal): java.lang.ExceptionInInitializerError
        at com.datastax.spark.connector.cql.DefaultConnectionFactory$.clusterBuilder(CassandraConnectionFactory.scala:35)
        at com.datastax.spark.connector.cql.DefaultConnectionFactory$.createCluster(CassandraConnectionFactory.scala:87)
        at com.datastax.spark.connector.cql.CassandraConnector$.com$datastax$spark$connector$cql$CassandraConnector$$createSession(CassandraConnector.scala:153)
        at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$2.apply(CassandraConnector.scala:148)
        at com.datastax.spark.connector.cql.CassandraConnector$$anonfun$2.apply(CassandraConnector.scala:148)
        at com.datastax.spark.connector.cql.RefCountedCache.createNewValueAndKeys(RefCountedCache.scala:31)
    

1 个答案:

答案 0 :(得分:0)

连接器附带的Guava版本与spark附带的版本之间存在已知冲突。你是怎么试图遮蔽番石榴图书馆的?

尝试将此添加到build.sbt文件中:

assemblyShadeRules in assembly := Seq(
  ShadeRule.rename("com.google.**" -> "shadeio.@1").inAll
)