I can't set up Hector for Cassandra. I've looked through the documentation and the Cassandra wiki. The problem with these docs is that a lot of the information there is outdated, or minimalistic (or I'm lacking knowledge). Anyway, I'm wondering if anyone can provide some rough simplistic guide as to how to go about installing it.
I'm aiming to build a JSP page that can use the Cassandra database.
What I've done so far:
I've downloaded Hector 1.0-2 and Cassandra 1.0.7.
I've set up Cassandra and checked it works (used CLI to create new columns using keys)
Tried unpacking the me.prettyprint.cassandra into the Java project directory but still nothing.
I'm also not sure where to get the thrift API (or how to install it)? And, if i need it at all?
Any help would be appreciated.
As I remember, it was very easy to install Cassandra, and get Hector to work for a basic insert, retrieve example. It's like
Install Cassandra
Create keyspace, and column families from Cassandra CLI.
Create a plain Java Maven project, and add Hector, and Thrift dependencies to it. (Maven is not necessary, I just meant a simple hello-world project here.)
Write insert code, then check into Cassandra using CLI.
Write retrieve query, then see if matches, and slices properly.
But that was Cassandra 0.6.0. Not sure what so hard.
Please look into this tutorial, and you can also see this simple source code for insertion.
If you land into some trouble come with specific problem, it will be much easier that way.
Hope this helps.
Related
We are creating Jmeter performance benchmarking for our Cassandra installation.
For which we have been referring to the default Cassandra plugin mentioned in the site
This plugin does not take any Cassandra server connection parameter for the "put", no much help is also present to how to use this plugin.
Some can help me with this plugin if any one knows how to configure Cassandra connection
Hence we switched to an article to test Cassandra with Groovy. (Link here)
This site calls to add multiple jar some are bundles and cannot find the exeat JAR
snappy-java-1.0.5
netty-transport-4.0.33.Final
netty-handler-4.0.33.Final
netty-common-4.0.33.Final
netty-codec-4.0.33.Final
netty-buffer-4.0.33.Final
metrics-core-3.1.2
lz4-1.2.0
HdrHistogram-2.1.4
guava-16.0.1
Can some help me with some simpler test perform on Cassandra ?
For correct performance testing of Cassandra it's better to use specialized tools, like NoSQLBench that was developed specifically for that task. Generic tools won't give you the real performance numbers. Please read NoSQLBench documentation on how to correctly test Cassandra to take into account things like compaction, repairs, etc.
Have you tried to read documentation which mentions CassandraProperties configuration element where you can define your connection server parameters:
If you want to have the full control and not only be limited to what other guys implemented you can consider following instructions from Cassandra Load Testing with Groovy article
I need to implement database migration scenario for a gradle and sbt application which uses cassandra.
if there is no any other way we can use flyway with cassandra, please suggest another tool which helps in maintaining versioning.
This looks tricky. A couple of alternative tools, inspired by Flyway, are mentioned in that issue that you could assess:
https://github.com/patka/cassandra-migration
https://github.com/Contrast-Security-OSS/cassandra-migration
I need an embedded cassandra for my project and I was wondering if I can use Stubbed Cassandra for data storage. Because I need a system to simulate CQL requests and responses.
Thanks everyone.
You cant use it as a real datastore. Use real cassandra as a real cassandra datastore. check out ccm which is probably more what your looking for.
There are wrappers for it in dtests (python) and the java driver uses it for testing and has a java wrapper.
I don't really have any experience at all with SCassandra but I worked on several projects using Apache Cassandra and there are some use cases like multidatacenter infrastructure to experiment and I don't think SCassandra can do it. So if you plan to do simple tests, that's fine, But advanced use cases really need to be tested in a real cassandra distribution.
As others have mentioned, you will need the real Cassandra for data storage. However, if you want to test CQL requests/responses then you can use this library:
Cassandra-Spy
It runs an actual embedded Cassandra and also can simulate failures for inserts/selects. This helps you test your app's behaviour in failure cases. I wrote the library to address this specific use case.
I know about the Cassandra PHP driver being in BETA. But I strongly believe DataStax offers the best solutions as far as PHP drivers go for Cassandra.
What I would love to try is to see if it's possible to get cassandra data into my PHP application using CQLSH and PHP shell commando's. (both Cassandra and PHP script run on the same server. )
Anyone ever tried this?
Would there be a method to get CQLSH return json or a different output instead of columns fit for my console?
Thanks for your insights.
cqlsh is built using the DataStax python driver. That being said, I would not recommend system calls to cqlsh using OS system calls from php. Not only is it impractical from a data format perspective, it is also hacky, I would not expect it to perform well, and it would be adding a lot of complexity and failure scenarios to your application.
For scalability, if you ever need to move your application to a different machine, you would not be able to. These are just a few of the downsides that I can think of from the top of my head.
You are better off using the beta PHP driver from DataStax or waiting for a stable version. RC1 is due to drop soon.
I can run this application with no issues with my sql.
https://github.com/spring-projects/spring-social-samples/tree/master/spring-social-showcase
Can I override the UserConnectionRepository to make this application work with cassandra.
Thanks
You probably don't want to "override" it, but rather create a new repository that provides the same functionality, but instead of JDBC it can use Datastax Cassandra driver for communication with Cassandra cluster. You can then use your new repository in place of the original one. If this project uses dependency injection, it should be 1 line change.
Word of caution, this project is rather basic and contains bad practices. If you just want to get your hands dirty, it's fine, but this is definitely not a good production sample (no error handling, lack of security checks, password stored in clear text etc).