cassandra database testing with jmeter - cassandra

I have installed cassandra CQL shell on my local system, I am using jmeter v3.0 for testing the queries per second(QPS) on cassandra CQL shell. I have installed "cassandra support" plugin available in "plugin manager" with jmeter.
I have created keyspace in cassandra(keyspace1), created a table(student) and added some data in CQL shell.
I have added "cassandra properties" from config elements and entered the properties in jmeter.
Here are the properties:
I have added "cassandra get" sampler.
added "view results tree" listener.
when I run it I am getting the following error:
ERROR: java.lang.RuntimeException:
org.apache.thrift.transport.TTransportException: Read a negative frame
size (-2080374784)!
I have given the "schema properties" as seen on github.
but no use. I am getting the same error.
Can anyone suggest me how to resolve this error?
ERROR: java.lang.RuntimeException:
org.apache.thrift.transport.TTransportException: Read a negative frame
size (-2080374784)!
I want to use the cassandra samplers for put, get and delete operations on the database.

It looks like the Netflix plugin you are using is somewhat deprecated because it uses the Cassandra thrift API which is deprecated (the plugin did not have a lot of recent commits in github too).
See announcements here and here
Even if you succeed in your test with this plugin, it would not be very representative of a current client use (hence load).
IMHO you should make your test with JSR223 groovy scripts (preprocessor and samplers) and use the Datastax standard java driver + CQL in your script. I did it some time ago, it works fine.
(update: documented here)
Or may be try this JMeter plugin from a Datastax guy, it seems to use CQL . I didn't tried it, but it looks fine.
HTH,
Alain

Related

Log all query in cassandra 3.4.4

I'm looking to log all logs in Cassandra 3.4.4 (for instance, to log if query was ok, bad, but also connection timed out or bad credentials). Thanks
Unfortunately Cassandra 3 doesn’t have a feature for that. However, there is an open source 3rd party plugin that does this.
Check out Ericsson’s Cassandra Query Logger:
https://github.com/Ericsson/ecaudit/
Basically, you download the JAR, add it to lib/, reference it in the Cassandra-env.sh, and that should do it.

Cassandra PER PARTITION LIMIT not working throwing error in dev center

I am trying to run below CQL query in dev center (1.6) and seeing this error thus not allowing me to execute query. I verified DataStax documentation and I see syntax is correct. Any help please?
select * from some_table PER PARTITION LIMIT 1;
Error I see -> no viable alternative at input 'PER
If you're using DataStax Enterprise 6.x, then you need to use DataStax Studio instead of DevCenter. DSE 6 supports per partition limit without problems, it's a DevCenter that doesn't understand this syntax.
My guess is that you're using a version of Cassandra that does not support that syntax.

Cassandra: need to migrate cassandra to log4j

We are using embedded cassandra in our groovy test cases, we are migrating from logback to log4j2. Whenever i run the groovy test which uses cassandra it gives an exception of NoClassDefFoundError for ch/qos/logback /classic /Logger. I have excluded logback dependency from all existing cassandra dependency still its looking for logback. How should i make cassandra log using log4j2
Cassandra isn't setup or designed to run embedded so while there might be some hacks that can get you by it will be something difficult to keep working across versions.
I would recommend using ccm for your tests to run it out of jvm and it will also give you more control for interesting configurations. The java driver has a useful bridge for java applications in their tests here: CCMBridge.java
Longterm you might be able to use something CASSANDRA-14821 as there will be native connections exposed and give you a lot more control over results of queries and such.

Migrate Datastax Enterprise Cassandra to Apache Cassandra or Datastax Community?

I have a large, but simple Cassandra database on a Datastax 4.6 cluster. The license renewal is prohibitive for this very simple use case and I am trying to migrate to either a straight Apache or Datastax Comunity version. First is it possible to do an inline update?
I have altered all the keyspaces to remove the "EverywhereStrategy" replication strategy but I still get an error that the DSC version of cassandra I'm trying to get to join the cluster doesn't support it. I'm using Like Cassandra versions (2.0.16) and most other things seem to be close.
java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Unable to find replication strategy class 'org.apache.cassandra.locator.EverywhereStrategy'
If it's not possible to do an inline upgrade what would be the best strategy to migrate a decent size (30 node, 150Tb) cluster?
So to make this work you have to extract any of the DSE features that you may have on any of your tables.
This meant I had to change the replication strategy on the dse_system table from EverywhereStrategy to SimpleStrategy with RF=3 (or almost anything after conversion you can drop this keyspace) The error message was:
java.lang.RuntimeException: org.apache.cassandra.exceptions.ConfigurationException: Unable to find replication strategy class 'org.apache.cassandra.locator.EverywhereStrategy'
I Also had to drop the unused CFS keyspaces. We never used the hadoop/CFS integration so we had nothing in these keyspaces anyway. I didn't capture the error for this.
We did have a solr index on a table we were testing on this cluster about a year ago so I had to drop this columnfamily. The error message was:
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex
There may be other incompatibilities if you use other features of Datastax Enterprise that you would have to remove, but this was enough for me to get the migration working.
dse-core.jar contains the EverywhereStrategy class.
We solved this problem by doing the following:
Replace everything except the above JAR so nodes can come up fine. Once all nodes are migrated to OSS, drop the dse_system keyspace (that uses this replication), delete the JAR and restart the nodes one by one.

org.jboss.netty.channel.ChannelPipelineException: Failed to initialize a pipeline

I have an application that connects to Cassandra using the Java Driver, fetches some configuration and based on the results generates and executes some PIG scripts.
Now, I am able to successfully connect to Cassandra, when jars required for PIG are not in the classpath. Similarly, I am able to launch PigServer class and execute scripts / statements using the entire DSE stack when I am not connecting to Cassandra using the java driver to retrieve the configuration.
When I use both of them I get following exception:
org.jboss.netty.channel.ChannelPipelineException: Failed to initialize a pipeline.
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:181)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)
... 35 more
Caused by: org.jboss.netty.channel.ChannelPipelineException: Failed to initialize a pipeline.
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:208)
at org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:182)
at com.datastax.driver.core.Connection.<init>(Connection.java:100)
at com.datastax.driver.core.Connection.<init>(Connection.java:51)
at com.datastax.driver.core.Connection$Factory.open(Connection.java:376)
at com.datastax.driver.core.ControlConnection.tryConnect(ControlConnection.java:207)
at com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:170)
at com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:87)
at com.datastax.driver.core.Cluster$Manager.init(Cluster.java:576)
at com.datastax.driver.core.Cluster$Manager.access$100(Cluster.java:520)
at com.datastax.driver.core.Cluster.<init>(Cluster.java:67)
at com.datastax.driver.core.Cluster.buildFrom(Cluster.java:94)
at com.datastax.driver.core.Cluster$Builder.build(Cluster.java:501)
I see others have seen similar exception, but when trying to execute Cassandra statements, from MapReduce tasks, which is not my case:
https://groups.google.com/a/lists.datastax.com/forum/#!topic/java-driver-user/FhW_8e4FyAI
http://www.datastax.com/dev/blog/the-native-cql-java-driver-goes-ga#comment-297187
Thanks!
DSE stacks connect to Cassandra through thrift API which is different from Cassandra Java Driver.
You can't use Cassandra Java driver for Pig/Hadoop before CASSANDRA-6311 is resolved.
There may be the bad security certificate/security certificate expiration issue if you are using certificate.

Resources