Cassandra cqlsh – connection refused

You need to edit cassandra.yaml on the node you are trying to connect to and set the node ip address for rpc_address and listen_address and restart Cassandra. rpc_address is the address on which Cassandra listens to the client calls. listen_address is the address on which Cassandra listens to the other Cassandra nodes.

Inner Join in cassandra CQL

Because of its distributed nature, Cassandra has no support for RDBMS style joins. You have a few options for when you want something like a join. One option perform separate queries and then have your application join the data itself. This makes sense if the data is relatively small and you only have to perform … Read more

cassandra get all records in time range

The timeout is because Cassandra is taking longer than the timeout (default is 10 seconds) to return the data. For your query, Cassandra will attempt to fetch the entire dataset before returning. For more than a few records this can easily take longer than the timeout. For queries that are producing lots of data you … Read more

How to create auto increment IDs in Cassandra

How about the following, using Cassandra’s Lightweight transactions 1 – Create IDs table: CREATE TABLE ids ( id_name varchar, next_id int, PRIMARY KEY (id_name) ) 2 – Insert every id you’d like to use a global sequence with For example: INSERT INTO ids (id_name, next_id) VALUES (‘person_id’, 1) 3 – Then, when inserting to a … Read more