Spark与Cassandra配置

时间:2014-03-21 06:05:09

标签: cassandra apache-spark

在cassandra上运行spark获取TTransportException。任何人都可以告诉我,是否有任何配置我必须通过spark进入acess cassandra db? 我将以下变量设置为.bashrc& conf / spark-env.sh文件:

export SCALA_HOME=/opt/scala-2.10.3  
export SCALA_LIBRARY_PATH=/opt/scala-2.10.3/lib  
export MAVEN_OPTS="-Xmx1300M -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=512m"  
export SPARK_HOME=/opt/spark-0.9.0  
export SPARK_CONF_DIR="$SPARK_HOME/conf"  
export SPARK_LOCAL_IP=192.168.140.35  
export SPARK_MASTER_IP=192.168.140.35  
export SPARK_MASTER_PORT=7077  
export SPARK_WORKER_MEMORY=1g  
export SPARK_MASTER_WEBUI_PORT=7123  
export SPARK_WORKER_PORT=8077  
export SPARK_WORKER_DIR=$SPARK_HOME/work  
export SPARK_WORKER_CORES=1  
export SPARK_WORKER_WEBUI_PORT=7456  
export SPARK_WORKER_INSTANCES=1  
export SPARK_CLASSPATH=/opt/cassandra/lib/apache-cassandra-1.2.12-    SNAPSHOT.jar:/opt/cassandra/lib/apache-cassandra-clientutil-1.2.12-SNAPSHOT.jar:/opt/cassandra/lib/apache-cassandra-thrift-1.2.12-SNAPSHOT.jar:/opt/cassandra/lib/commons-cli-1.1.jar:/opt/cassandra/lib/commons-codec-1.2.jar:/opt/cassandra/lib/commons-lang-2.6.jar:/opt/cassandra/lib/compress-lzf-0.8.4.jar:/opt/cassandra/lib/cql-internal-only-1.4.1.zip:/opt/cassandra/lib/high-scale-lib-1.1.2.jar:/opt/cassandra/lib/jackson-core-asl-1.9.2.jar:/opt/cassandra/lib/jackson-mapper-asl-1.9.2.jar:/opt/cassandra/lib/amm-0.2.5.jar:/opt/cassandra/lib/jbcrypt-0.3m.jar:/opt/cassandra/lib/jline-1.0.jar:/opt/cassandra/lib/json-simple-1.1.jar:/opt/cassandra/lib/libthrift-0.7.0.jar:/opt/cassandra/lib/log4j-1.2.16.jar:/opt/cassandra/lib/lz4-1.1.0.jar:/opt/cassandra/lib/metrics-core-2.2.0.jar:/opt/cassandra/lib/netty-3.6.6.Final.jar:/opt/cassandra/lib/servlet-api-2.5-20081211.jar:/opt/cassandra/lib/slf4j-api-1.7.2.jar:/opt/cassandra/lib/lf4j-log4j12-1.7.2.jar:/opt/cassandra/lib/snakeyaml-1.6.jar:/opt/cassandra/lib/snappy-java-1.0.5.jar:/opt/cassandra/lib/snaptree-0.1.jar  
export PATH=$PATH:$M2:$JAVA_HOME/bin:$HADOOP_HOME/bin:$CASSANDRA_HOME/bin:$SQOOP_HOME/bin:$OOZIE_HOME/bin:$PIG_HOME/bin:$HIVE_HOME/bin:$ANT_HOME/bin:$SCALA_HOME/bin

2 个答案:

答案 0 :(得分:0)

看看这个库http://tuplejump.github.io/calliope/的spark cassandra integration.DataStax还发布了一个Spark驱动程序,可以在这里找到https://github.com/datastax/spark-cassandra-connector

答案 1 :(得分:-1)

我已成功尝试了此blog条指示。

快乐测试!

编辑:对不起,实际上我已尝试在给定的博客帖子和来自shark的非常简单的文档之间进行组合。