Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.
/ Spark-Cassandra-Demo Public archive

Demo code for loading data into Cassandra and Solr with Spark.

Notifications You must be signed in to change notification settings

o19s/Spark-Cassandra-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cassandra Spark Demo

Retrieve Sample Data

curl http://deron.meranda.us/data/census-dist-all-last.txt.gz | gunzip - > cassandra_import_example/data/census-dist-all-last.txt
curl http://deron.meranda.us/data/census-dist-female-first.txt > cassandra_import_example/data/census-dist-female-first.txt
curl http://deron.meranda.us/data/census-dist-male-first.txt > cassandra_import_example/data/census-dist-male-first.txt

Setup

  1. Install DSE
    1. Download installer - http://www.datastax.com/download
    2. Run installer
  2. Install Solr

Running Services

  1. Start DSE (w/ Spark)

    ~/dse/bin/dse cassandra -k
  2. Start Solr

    cd solr
    bin/solr -c

Loading Schema

Ensure the services are both running

  1. DSE

    cqlsh -f cassandra_import_example/schema.cql
  2. Solr

    solr/bin/solr create_collection -c solr_import_example -d solr_import_example/solr_core_config/

Building Examples

cd cassandra_import_example && mvn package
cp ~/dse/lib/dse-4.7.0.jar solr_import_example/lib/
cd solr_import_example && sbt assembly

Running Examples

java -jar cassandra_import_example/target/cassandra_import_example-1.0-SNAPSHOT-jar-with-dependencies.jar
dse spark-submit --executor-memory 1G target/scala-2.11/solr_import_example-assembly-1.0.jar

Stopping Services

dse cassandra-stop
solr/bin/solr stop

About

Demo code for loading data into Cassandra and Solr with Spark.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published