cassandra

What are best practices for backing up a cassandra cluster?

久未见 提交于 2020-01-03 08:52:55
问题 I have a cassandra cluster with ~20 nodes in multiple datacenters. I want to back up the cassandra database. I want it to be possible to restore the backup to a new cluster even if every node in the existing one is simultaneously hit by a meteor. What exactly do I need to copy off of the server(s) and preserve in order to make a from-scratch restore of a cassandra database possible, and where are these items stored? I gather that this is not as simple as "take a snapshot and rsync it

How to run Cassandra (cqlsh) from anywhere

≯℡__Kan透↙ 提交于 2020-01-03 08:50:14
问题 In Cassandra the official documentation (https://wiki.apache.org/cassandra/GettingStarted) it states, to start the service use 'bin/cassandra -f' Then use 'bin/cqlsh' to access. But to use cqlsh in this way I always have to go to the bin folder. What is the procedure to make it work such that I can type 'cqlsh' from anywhere in the console to access (not have to be in the bin folder of Cassandra setup) ? (just like we access python directly from anywhere by just typing python3 in console )

How to run Cassandra (cqlsh) from anywhere

天大地大妈咪最大 提交于 2020-01-03 08:50:13
问题 In Cassandra the official documentation (https://wiki.apache.org/cassandra/GettingStarted) it states, to start the service use 'bin/cassandra -f' Then use 'bin/cqlsh' to access. But to use cqlsh in this way I always have to go to the bin folder. What is the procedure to make it work such that I can type 'cqlsh' from anywhere in the console to access (not have to be in the bin folder of Cassandra setup) ? (just like we access python directly from anywhere by just typing python3 in console )

InvalidRequestException(why:empid cannot be restricted by more than one relation if it includes an Equal)

自古美人都是妖i 提交于 2020-01-03 08:49:14
问题 This is regarding an issue I am facing while querying Cassandra from Apache Spark. The normal query from Spark works fine without any issues , however when I query with a condition which is the key I get the below error. Initially I tried querying for a composite key column family and it was also giving the same issue as below. "Caused by: InvalidRequestException(why:empid cannot be restricted by more than one relation if it includes an Equal)" Column Family: CREATE TABLE emp ( empID int,

CQLSH client - module' object has no attribute 'parse_options

拟墨画扇 提交于 2020-01-03 08:38:09
问题 I'm trying to access my Cassandra server through a CQLSH client to import a huge CSV file. I'm getting a module' object has no attribute 'parse_options error. I run the follow command: cqlsh XXX.XXX.XX.XX XXXX --cqlversion="3.4.2" --execute="copy evolvdso.teste from '2016-10-26 15:25:10.csv' WITH DELIMITER =',' AND HEADER=TRUE --debug"; This is the debug and error message that follows: Starting copy of evolvdso.teste with columns ['ref_equip', 'date', 'load', 'ptd_assoc']. Traceback (most

Cassandra assynchronous execution in multiple processes blocking synchronous requests

為{幸葍}努か 提交于 2020-01-03 04:40:11
问题 I have an application that reads a series of XML files containing logs of vehicles passages in a road. The application then processes each record, transform a few of the informations to match the database columns and inserts it into a cassandra database (running a single node in a remote server [it's in an internal network so connection isn't really an issue]). After inserting data in the database, the process for each file then goes on to read this data and produce information for summary

How do I load a lot of data at once in a Cassandra “cluster” of one node?

北城以北 提交于 2020-01-03 03:11:10
问题 I am working on a multi website system which uses Cassandra to handle all of its data needs. When I first install a website, it adds 3918 pages (and growing) with many fields, attachments such as JS files, links between pages, etc. At some point, my test "cluster" (one node) decides that the data is coming to fast and it times out or worst, Cassandra "crashes" because of an out of memory (OOM). More or less, from what I can see the 2Gb of RAM allocated by Cassandra fills up and then, more

NoClassDefFoundError - datastax java driver for Cassandra

限于喜欢 提交于 2020-01-02 23:14:33
问题 I am currently unable to connect to my cassandra database using the datastax driver. I am getting the following error: com.datastax.driver.core.TransportException: [/127.0.0.1] Unexpected exception triggered (java.lang.NoSuchMethodError: com.google.common.collect.ImmutableSet.copyOf(Ljava/util/Collection;)Lcom/google/common/collect/ImmutableSet;) at com.datastax.driver.core.Connection$Dispatcher.exceptionCaught(Connection.java:556) at org.jboss.netty.channel.SimpleChannelUpstreamHandler

How to test a Spark SQL Query without Scala

一曲冷凌霜 提交于 2020-01-02 20:43:32
问题 I am trying to figure out how to test Spark SQL queries against a Cassandra database -- kind of like you would in SQL Server Management Studio. Currently I have to open the Spark Console and type Scala commands which is really tedious and error prone. Something like: scala > var query = csc.sql("select * from users"); scala > query.collect().foreach(println) Especially with longer queries this can be a real pain. This seems like a terribly inefficient way to test if your query is correct and

How to executing batch statement and LWT as a transaction in Cassandra

杀马特。学长 韩版系。学妹 提交于 2020-01-02 11:27:09
问题 I have two table with below model: CREATE TABLE IF NOT EXISTS INV ( CODE TEXT, PRODUCT_CODE TEXT, LOCATION_NUMBER TEXT, QUANTITY DECIMAL, CHECK_INDICATOR BOOLEAN, VERSION BIGINT, PRIMARY KEY ((LOCATION_NUMBER, PRODUCT_CODE))); CREATE TABLE IF NOT EXISTS LOOK_INV ( LOCATION_NUMBER TEXT, CHECK_INDICATOR BOOLEAN, PRODUCT_CODE TEXT, CHECK_INDICATOR_DDTM TIMESTAMP, PRIMARY KEY ((LOCATION_NUMBER), CHECK_INDICATOR, PRODUCT_CODE)) WITH CLUSTERING ORDER BY (CHECK_INDICATOR ASC, PRODUCT_CODE ASC); I