How Cassandra identifies the node for replication in a multi data center multi rack multi node setup

I understood that Cassandra tries to replicate data across different rack - different DC to handle fail over...For Example : Suppose I have a total 8 node cluster spanning across 2 different DCs, each DC having 2 racks.Node 1 - DC1 RACK 1 | Node 2 - DC1 RACK 1 | Node 3 - DC1 RACK 2 | Node 4 - DC1 RACK 2 | Node 5 - DC2 RACK 1 | Node 6 - DC2 RACK 1 | Node 7 - DC2 RACK 2 | Node 8 - DC2 RACK 2 Now if I have a RF of 3, then while writing a row , Cassandra will store 1st copy of the row on the node(let say in this case Node 1) which is respons...Read more

cassandra.yaml changes not working at all

Im new using Cassandra 3.11.4, and just installed it on a ubuntu VM, and following the instructions, I tried to change the cluster name on the .yaml config file, but when I save the doc, and go Start Cassandra, it throws a failure, and this happens with anything I change on the .yaml file, it just doesn't work the way documentation says it should(I located the Cassandra files in a location where my user has all permissions)enter image description here. enter image description hereIf I make no changes to the file, and Start Cassandra, it does su...Read more

cassandra 3.0 - ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes

I am getting below error on,ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}version details, [cqlsh 5.0.1 | Cassandra 3.11.4 | CQL spec 3.4.4 | Native protocol v4]cqlsh:infinito> select count(id) from list_subscriber;This table contains only 10 lacks of records, and primary key is on 'Id' column only having int type.I am trying to increase some time...Read more

apache kafka connect - Cassandra WriteTimeOut Exception at ConsistencyLevel.LOCAL_QUORUM

I am facing WriteTimeOutException while writing to Cassandra using CassandraSinkConnector at ConsistencyLevel.LOCAL_QUORUM.I am using Cassandra 3.3.0 versionSo i need help how to handle and fix this exception?Stack-Trace:-WorkerSinkTask due to unrecoverable exception.org.apache.kafka.connect.runtime.WorkerSinkTask.deliverMessages(WorkerSinkTask.java:546) org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:302)org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:205)org.apache.kafka.connect.runtime.W...Read more

cql3 - Querying in cassandra cql

I am new to cassandra. suppose i have a table named customer with fields id as primary key,age, firstname and lastname. Also take it as there is so many datas in that table. How can query in that table to get my senario like, "a search query. that is is a select statement to obtain below senarios."datas with have both firstname="something" and last name="something",that is query for satisfying bothIf firstname=null and lastname='something that we given' if lasttname=null and firstname'something that we given' How can we query with a single cq...Read more

Error while starting Cassandra for first time

I am attempting to start Cassandra for the first time on a Redhat machine. I have successfully done so on my practice Ubuntu machines, but for some reason, the Redhat install is giving me the following errors: INFO [main] 2017-06-29 20:11:42,369 YamlConfigurationLoader.java:89 - Configuration location: file:/home/cassandra/apache-cassandra-3.10/conf/cassandra.yaml Exception (org.apache.cassandra.exceptions.ConfigurationException) encountered during startup: Invalid yaml: file:/home/cassandra/apache-cassandra-3.10/conf/cassandra.yaml Error:...Read more

Why am I getting Cassandra prepared statement recreation error on startup from dropped keyspaces?

I am running a 2 node (8 cores per node) Cassandra 3.10 cluster with a replication factor of 1. I have and have had a number of keyspaces over time on my cassandra cluster.I have noticed lately that when I stop/start the times to come back up are extremely slow. I am seen thousands of "prepared statement recreation" stack traces as per below example in both my system.log and debug.log. It appears that Cassandra is attempting to prepare statements for keyspaces that no longer exist as I have previously dropped them.Note I do not have any...Read more

How to provide 'only insert' privilege to a role in Cassandra?

I am creating a keyspace in Cassandra and I would like to provide different permissions like Insert and update only, delete only etc.Cassandra provides MODIFY privilege as a whole. But I could not find any resources as to how this can be done to meet my requirement.As of now, For example, if a role 'clerk' can only insert, I am planning to provide MODIFY privilege to 'clerk' and write a trigger to avoid deletes from that role. This feels like a roundabout tour. Is this a good way? Can it be done in a better or straight-forward way?...Read more

in cassandra Maximum memory usage reached (536870912 bytes), cannot allocate chunk of 1048576 bytes

I'm using apache cassandra-3.0.6 ,4 node cluster, RF=3, CONSISTENCY is '1', Heap 16GB.Im getting info message in system.log as "INFO [SharedPool-Worker-1] 2017-03-14 20:47:14,929 NoSpamLogger.java:91 - Maximum memory usage reached (536870912 bytes), cannot allocate chunk of 1048576 bytes"don't know exactly which memory it mean and I have tried by increasing the file_cache_size_in_mb to 1024 from 512 in Cassandra.yaml file But again it immediatly filled the remaining 512MB increased and stoping the application recording by showing the same info...Read more

What are allowable values for allocate_tokens_for_keyspace in cassandra.yaml?

Cassandra 3.0 added a new option to optimize the load across nodes, allocate_tokens_for_keyspace, in cassandra.yaml with default value KEYSPACE.Does a specific keyspace need to be provided? What does the default value KEYSPACE do?If it needs to be specific, how do I specify multiple keyspaces for anode?Experimenting with different values I have been able to put random strings and comma separated lists in when adding a node and the new node joins the cluster but there are no useful messages in the debug log saying whether the value is valid or ...Read more

cassandra 3.0 - Why my cql query with double quotes doesn't work but with single quotes works?

Are double quotes not allowed in cql?running this query worksval statement4 = s""" | INSERT INTO users (bucket,email,firstname,lastname,authprovider,password,confirmed,id,hasher,salt) VALUES | (1,'${testEnv.email}','fn','ln','${testEnv.loginInfo.providerID}','somePassword',false,${testEnv.mockHelperMethods.getUniqueID()},'someHasher','someSalt') """.stripMarginbut this doesn't (because I am using double quotes)val statement4 = s""" | INSERT INTO users (bucket,email,firstname,lastname,authprovid...Read more

how to get descriptive error messages from embedded cassandra

I am using embedded cassandra to run unit tests. I notice that if any cql statements fail, then I don't see any descriptive reason for failure. For eg. I am running the following two statements which fails because I am trying to add a table without switching to a keyspaceval statement1 = """ |CREATE KEYSPACE test | WITH REPLICATION = { | 'class' : 'SimpleStrategy', | 'replication_factor' : 1 | }; """.stripMargin val statement3 = """ |CREATE TABLE users ( ...Read more

unable to figure out if my scripts executed correctly in embedded-cassandra

I have created a unit-test which uses embedded-cassandra and executes some scripts. But I am not able to figure out if the scripts ran successfully or not.I see the following two prints (maybe because I have two statements). Is there a way to get the result of the execution and print it on the console.WARN c.d.d.c.Connection - /127.0.0.1:9042 did not send an authentication challenge; This is suspicious because the driver expects authentication (configured auth provider = com.datastax.driver.core.PlainTextAuthProvider)WARN c.d.d.c.Connection - /...Read more

how to use embedded-cassandra without any test framework

I have a play/scala application and uses cassandra database. I read about embedded-cassandra and am trying to use it. My application doesn't use any test frameworks like junit (I'll prefer not to use them to avoid if possible).So far, I have created a factory and a cqlstatement. But I can't figure out how to execute the statement. Referring to the wiki, it refers to TestCassandra but my IDE can't find this class. Do I need to use TestNG or Junit4?class UsersRepositorySpecs extends PlaySpec /*with BeforeAndAfterAll with BeforeAndAfterEach with ...Read more

How do I get a specific version of Cassandra in Embedded-Cassandra

In Embedded-Cassandra (https://github.com/nosan/embedded-cassandra/wiki), the default version seem to be 3.11.4. I want to use 3.11.3. I tried setting the version but got error val factory = new LocalCassandraFactory println(s"factory is ${factory}") factory.setVersion(("3.11.1"))...ErrorWARN c.g.n.e.c.l.a.RemoteArtifact - HTTP (404 Not Found) status for URL 'http://www.mirrorservice.org/sites/ftp.apache.org/cassandra/3.11.3/apache-cassandra-3.11.3-bin.tar.gz'Indeed, the version doesn't exist at http://www.mirrorservice.org/sites/ftp....Read more