Giter VIP home page Giter VIP logo

cassandra-river's Introduction

Cassandra river for Elastic search.

This river was a proof of concept for integration of cassandra with elasticsearch, its a 2 day hacked up solution.

##Setup

Build: mvn clean package

Install: ./bin/plugin -url file:elasticsearch-river-cassandra/target/releases/elasticsearch-river-cassandra-1.0.0-SNAPSHOT.zip -install river-cassandra

Remove: ./bin/plugin -remove river-cassandra

##Init

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,host2:9161",
		"username" : "username",
		"password" : "password"
    },
    "index" : {
        "index" : "prodinfo",
        "type" : "product"
    }
}'

##Query

  1. localhost:9200/info/_search
  2. localhost:9200/info/_count

##References

  1. http://jfarrell.github.com/
  2. Setup elasticsearch-head and bigdesk to monitor ES

##Improvements

  1. http://mail-archives.apache.org/mod_mbox/cassandra-user/201303.mbox/%[email protected]%3E
  2. https://groups.google.com/forum/?fromgroups=#!topic/elasticsearch/M1aJqvAIpZE
  3. Tests

cassandra-river's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cassandra-river's Issues

Issue at mvn clean package test

We have a cassandra cluster, and want to index all data from differetens CF's to an elasticsearch.

We want to use cassandra-river but we have a problem when building this

at "mvn clean package" when Test starts, we get this errors.

Exception in thread "Queue-Indexer-thread-408" java.lang.NullPointerException
at org.elasticsearch.river.cassandra.CassandraRiver$Indexer.run(CassandraRiver.java:149)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)

Any help would be appreciated!

indexing a cassandra column family

I have successfully installed the river and can successfully connect to the cassandra cluster, however I am missing something fundamental since I cannot see a index building.

I have 10,000 rows in my CF in a 3 node cluster
and see activity in the ES logs
[2014-02-27 16:01:03,516][INFO ][river.cassandra ] [Warren III Worthington] [cassandra][maccasIndex] Starting thread with 1000 keys
[2014-02-27 16:01:03,716][INFO ][river.cassandra ] [Warren III Worthington] [cassandra][maccasIndex] Starting thread with 738 keys

this repeats over and over again.

I am not using Auth in the cluster so have omitted the properties

sanitised

curl -XPUT 'localhost:9200/_river/maccasIndex/_meta' -d '{
"type" : "cassandra",
"cassandra" : {
"cluster_name" : "MaccasCluster",
"keyspace" : "MaccasKeyspace",
"column_family" : "MaccasCF",
"batch_size" : 1000,
"hosts" : "dsc1n1:9160,dsc1n2:9160,dsc1n3:9160"

},
"index" : {
    "index" : "maccasIndex",
    "type" : "cassandra"
}

}'

Cassandra info:
[cqlsh 3.1.2 | Cassandra 1.2.6.1 | CQL spec 3.0.0 | Thrift protocol 19.36.0]

the CF definition:

CREATE TABLE "MaccasCF" (
key text PRIMARY KEY,
"___class" text,
"addressLine1" text,
"addressLine2" text,
......


I am definitely missing something

http://localhost:9200/_status?pretty=1

{
"_shards" : {
"total" : 2,
"successful" : 1,
"failed" : 0
},
"indices" : {
"_river" : {
"index" : {
"primary_size_in_bytes" : 3820,
"size_in_bytes" : 3820
},
"translog" : {
"operations" : 0
},
"docs" : {
"num_docs" : 1,
"max_doc" : 1,
"deleted_docs" : 0
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 2,
"total_time_in_millis" : 84
},
"flush" : {
"total" : 1,
"total_time_in_millis" : 20
},
"shards" : {
"0" : [ {
"routing" : {
"state" : "STARTED",
"primary" : true,
"node" : "czJqPzFBSseiXoKX0YtWkA",
"relocating_node" : null,
"shard" : 0,
"index" : "_river"
},
"state" : "STARTED",
"index" : {
"size_in_bytes" : 3820
},
"translog" : {
"id" : 1393509195769,
"operations" : 0
},
"docs" : {
"num_docs" : 1,
"max_doc" : 1,
"deleted_docs" : 0
},
"merges" : {
"current" : 0,
"current_docs" : 0,
"current_size_in_bytes" : 0,
"total" : 0,
"total_time_in_millis" : 0,
"total_docs" : 0,
"total_size_in_bytes" : 0
},
"refresh" : {
"total" : 2,
"total_time_in_millis" : 84
},
"flush" : {
"total" : 1,
"total_time_in_millis" : 20
}
} ]
}
}
}
}

http://localhost:9200/_river/maccasIndex/_mapping?pretty=1
{
"_river" : {
"mappings" : {
"maccasIndex" : {
"properties" : {
"cassandra" : {
"properties" : {
"batch_size" : {
"type" : "long"
},
"cluster_name" : {
"type" : "string"
},
"column_family" : {
"type" : "string"
},
"hosts" : {
"type" : "string"
},
"keyspace" : {
"type" : "string"
}
}
},
"index" : {
"properties" : {
"index" : {
"type" : "string"
},
"type" : {
"type" : "string"
}
}
},
"type" : {
"type" : "string"
}
}
}
}
}

}

if I run:

http://localhost:9200/_river/maccasIndex/_search?q=_:_pretty=1

I get
{"took":268,"timed_out":false,"_shards":{"total":1,"successful":1,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}

but no sign of any indexed data

Can you tell me where I am going wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.