我已经在EMR 4.4.0上部署了Spark 1.6,我正在连接到在EC2上部署的datastax cassandra 2.2.5。
该连接使用spark-connector 1.4.2_s2.10将数据保存到cassandra中(因为它有guava14),但是使用1.4.2版本的connector从cassandra读取数据失败。
正确的组合建议使用1.5.x,因此我开始使用1.5.0。首先,我遇到了芭乐问题,并使用userClasspathFirst解决方案解决了它。
spark-shell --conf spark.yarn.executor.memoryOverhead=2048
--packages datastax:spark-cassandra-connector:1.5.0-s_2.10
--conf spark.cassandra.connection.host=10.236.250.96
--conf spark.executor.extraClassPath=/home/hadoop/lib/guava-16.0.1.jar:/etc/hadoop/conf:/etc/hive/conf:/usr/lib/hadoop-lzo/lib/*:/usr/share/aws/aws-java-sdk/*:/usr/share/aws/emr/emrfs/conf:/usr/share/aws/emr/emrfs/lib/*:/usr/share/aws/emr/emrfs/auxlib/*
--conf spark.driver.extraClassPath=/home/hadoop/lib/guava-16.0.1.jar:/etc/hadoop/conf:/etc/hive/conf:/usr/lib/hadoop-lzo/lib/*:/usr/share/aws/aws-java-sdk/*:/usr/share/aws/emr/emrfs/conf:/usr/share/aws/emr/emrfs/lib/*:/usr/share/aws/emr/emrfs/auxlib/*
--conf spark.driver.userClassPathFirst=true
--conf spark.executor.userClassPathFirst=true现在我通过了Guava16错误,但是由于我正在使用userClassPathFirst,我面临着另一个冲突,并且我没有任何方法来解决它。
Lost task 2.1 in stage 2.0 (TID 6, ip-10-187-78-197.ec2.internal): java.lang.LinkageError:
loader constraint violation: loader (instance of org/apache/spark/util/ChildFirstURLClassLoader) previously initiated loading for a different type with name "org/slf4j/Logger"当我使用Java代码而不是spark-shell重复这些步骤时,我也遇到了同样的问题。有没有什么解决方案可以克服它,或者其他更干净的方法?
谢谢!
发布于 2016-10-25 17:54:52
当使用'userClassPathFirst‘标志时,我得到了同样的错误。
从配置中删除这两个标志,只需使用'extraClassPath‘参数。
https://stackoverflow.com/questions/36273337
复制相似问题