# Load cassandra data into elasticsearch

**URL:** <https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590>\
**Category:** Elasticsearch\
**Created:** [January 7, 2016, 10:02am UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590 "2016-01-07T10:02:10Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![soujanya](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@soujanya](https://discuss.elastic.co/u/soujanya)\
**Post date:** [January 7, 2016, 10:02am UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/1 "2016-01-07T10:02:10Z")

</div>

Hi all,  
My requirement is to load data from cassandra column family into elasticsearch.For that I have successfully install the plugins(mapper attachments and cassandra-river) required for cassandra integration into elasticsearch. And I tried to load data of cassandra into elasticsearch using curl as below  
curl -XPUT 'localhost:9200/\_river/prodinfo/\_meta' -d '{  
"type" : "cassandra",  
"cassandra" : {  
"cluster\_name" : "test-cluster",  
"keyspace" : "catalogks",  
"column\_family" : "info",  
"batch\_size" : 1000,  
"hosts" : "host1:9161",  
"username" : "username",  
"password" : "password"  
},  
"index" : {  
"index" : "prodinfo",  
"type" : "product"  
}  
}'  
The index is creating with the cassandra credentials which ever I have given in above,but there is no data and columns related to cassandra keyspace,column family. How should I acheive that. Any help would be greatly appreciated.

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 7, 2016, 12:52pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/2 "2016-01-07T12:52:06Z")

</div>

Rivers have been removed in elasticsearch 2.0 so you should not use them.

I'd try to inject data in Cassandra and Elasticsearch at the same time in your application layer.

---

<div class="post-metadata">

**Author:** ![soujanya](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@soujanya](https://discuss.elastic.co/u/soujanya)\
**Post date:** [January 7, 2016, 12:55pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/3 "2016-01-07T12:55:31Z")

</div>

Hi David,

Thank you for your prompt reply. But is there any other way to load cassandra data into elasticsearch. Please help me out in resolve this.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [January 7, 2016, 12:58pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/4 "2016-01-07T12:58:19Z")

</div>

I don't know any.

I'd read the data from Cassandra using my application layer and send JSON docs to ES then.

May be you can try a JDBC Driver for Cassandra and use JDBC input plugin from Logstash or [jdbc importer](https://github.com/jprante/elasticsearch-jdbc)?

---

<div class="post-metadata">

**Author:** ![soujanya](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@soujanya](https://discuss.elastic.co/u/soujanya)\
**Post date:** [January 7, 2016, 1:02pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/5 "2016-01-07T13:02:22Z")

</div>

Thank you for reply, I'll try using any driver for Cassandra.

---

<div class="post-metadata">

**Author:** ![ara](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@ara](https://discuss.elastic.co/u/ara)\
**Post date:** [January 10, 2016, 12:15pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/6 "2016-01-10T12:15:07Z")

</div>

Hi Soujanya,

you could use the datastax driver to connect to cassandra, select data you want to import and push it into ES with an http client and bulk API.  
The Cassandra datastax driver is available in java (maven package or link on datastax site) or c# ([nuget.org](http://nuget.org) package). the java driver is a native not jdbc but usage is quite similar.  
Both java and c# work very well, just be careful to use the version in sync with your cassandra install to avoid problems, some system tables changes broke things between versions.

For ES, an http client of your choice (apache http components in java or standard dotnet HttpClient in c#) with bulk API.

A problem you may have is that Cassandra is a distributed key value store and have strong limitations on SELECt statements in where clause and with table / partitions scans.  
If you know the cassandra data model, and can deal with it this is fine, if you don't and want to do a basic 'SELECT \* -or some columns-' without WHERE, I suggest you have a look at:  
[http://www.myhowto.org/bigdata/2013/11/04/scanning-the-entire-cassandra-column-family-with-cql/](http://www.myhowto.org/bigdata/2013/11/04/scanning-the-entire-cassandra-column-family-with-cql/)  
to give you hints about paging the SELECT to deal with cluster partitions.

HTH

Regards,

Alain

---

<div class="post-metadata">

**Author:** ![Chiranjith\_Rai](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Chiranjith\_Rai](https://discuss.elastic.co/u/Chiranjith_Rai)\
**Post date:** [November 30, 2016, 7:25am UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/7 "2016-11-30T07:25:06Z")

</div>

Hi David,  
What is the reason for removing the feature **river** from elasticsearch?  
any issues with it?  
any alternate solutions for the same operation?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 3, 2016, 10:11pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/8 "2016-12-03T22:11:50Z")

</div>

You probably want tor read

> **[Deprecating Rivers
	  	 | Elastic](https://www.elastic.co/blog/deprecating-rivers)**
>
> When I added rivers way back in time in the early days of Elasticsearch, the idea was somewhat novel. One of the first tasks that users do when using Elasticsearch is to get data into Elasticsearch to...

---

<div class="post-metadata">

**Author:** ![Chiranjith\_Rai](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@Chiranjith\_Rai](https://discuss.elastic.co/u/Chiranjith_Rai)\
**Post date:** [December 5, 2016, 5:06am UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/9 "2016-12-05T05:06:42Z")

</div>

Thnak you Mr. David

---

<div class="post-metadata">

**Author:** ![Alberto\_Sao\_Marcos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alberto_sao_marcos/32/14923_2.png) [@Alberto\_Sao\_Marcos](https://discuss.elastic.co/u/Alberto_Sao_Marcos)\
**Post date:** [January 26, 2017, 10:41am UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/10 "2017-01-26T10:41:32Z")

</div>

I'm also looking into an solid option to index C\* into ES.  
any news on the subject?

---

<div class="post-metadata">

**Author:** ![sumit\_gupta\_sgt](https://avatars.discourse-cdn.com/v4/letter/s/dec6dc/32.png) [@sumit\_gupta\_sgt](https://discuss.elastic.co/u/sumit_gupta_sgt)\
**Post date:** [March 29, 2017, 5:04pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/11 "2017-03-29T17:04:07Z")

</div>

@soujanya Did you tried [jdbc importer](https://github.com/jprante/elasticsearch-jdbc)?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:01pm UTC](https://discuss.elastic.co/t/load-cassandra-data-into-elasticsearch/38590/12 "2017-07-05T22:01:45Z")

</div>


