4
votes

Running spark on cassandra getting TTransportException. Can anybody tell me, is there any configuration i have to make to acess cassandra db through spark ?
I set following variable into .bashrc & conf/spark-env.sh file :

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

2 Answers

0
votes

Take a look at at this library http://tuplejump.github.io/calliope/ for spark cassandra integration.DataStax has also released a Spark driver which can be found here https://github.com/datastax/spark-cassandra-connector

-1
votes

I've tried this blog instructions successfully.

Happy testing!

Edit: Sorry, actually I've tried a combo between the given blog post and the pretty straightforward documentation from shark.