w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
  Home » CASSANDRA » Page 1
Cassandra saving time series for industry data sensors
It's not quite clear what your query is. You mention "I want to retrieve the data at least every second for the analogic values (for example motor rmp, temperature, humidity....)". Does that mean you're querying every second for all 10K sensors? Or for a specific sensor, or for a group of sensors? In cassandra, it's vital to know what your query is before looking at data models. If you're looking

Categories : Cassandra

Create table using cqlsh does not return to prompt
I tried your CREATE TABLE command on the same version of Cassandra using cql 3 and it just worked. It failed using cql 2. If you're still using cql 2, that's likely the source of your problem.

Categories : Cassandra

Is it possible to tell cassandra to run a query only on the local node
It turns out that there was a bug in Cassandra versions 2.0.5-2.0.9 that would make Cassandra more likely to request data on two nodes when it only needed to talk to one. Upgrading to 2.0.10 or greater resolves this problem. Refer: CASSANDRA-7535

Categories : Cassandra

How to get a range of data from Cassandra
Can I keep timeuuid as primary key and meet the requirement? Not really, no. From http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/select_r.html WHERE clauses can include a greater-than and less-than comparisons, but for a given partition key, the conditions on the clustering column are restricted to the filters that allow Cassandra to select a contiguous ordering of

Categories : Cassandra

cassandra copy data from one columnfamily to another columnfamily from two different keyspaces
you can use copy command in cqlsh.. COPY keyspacename1.columnfamilyname1 (id, name, email) TO 'temp.csv'; COPY keyspacename2.columnfamilyname2 (id, name, email) FROM 'temp.csv';

Categories : Cassandra

Why Cassandra respond slowly on fetching data than splitting to different range queries?
The configuration is not a factor, but the way Cassandra works. Using the default Murmur3Partitioner (recommended), querying by PLOT_ID partition key, which is a compound primary key, is retrieving all rows stored by (PLOT_ID INDEX_VALUE). When you include the INDEX_VALUE in the query, Cassandra retrieves less data, so I think this explains why it doesn't take so long for the query. Over the past

Categories : Cassandra

Cassandra Nodetool netstats. What exactly am i monitoring?
The numbers you see in the netstats output are actual counts. See this doc link: http://www.datastax.com/documentation/cassandra/2.0/cassandra/tools/toolsNetstats.html Could you elaborate on what you mean by thresholds, where are you seeing this, or what blog are you referring to?

Categories : Cassandra

Cassandra DC2 nodes down after increasing write requests on DC1 nodes
When you specify Consistency Level of LOCAL_ONE you are telling Cassandra to consider the write request successful as soon as one of the local replicas has received the update. However, the request is still sent to ALL replicas. The nodes in the other DC are getting the request at the same time. Due to network latency, the actual work from the request will likely be done shortly after the write re

Categories : Cassandra

How can i access cfs url from a remote non dse (datastax) node
There is some info in the middle of this page about Spark using Hadoop for some operations, such as CFS access: http://www.datastax.com/documentation/datastax_enterprise/4.5/datastax_enterprise/spark/sparkCassProps.html I heard about a problem using Hive from a non-DSE node that was solved by adding a property file to core-site.xml. This is really a long-shot since it's Spark, but if you're will

Categories : Cassandra

Cassandra "Unexpected error deserializing mutation" error
I also encounter this problem. I'd like to share how I resolve the problem. Change the debug mode The default debug mode is INFO, the output is too less to track the error. You should change the debug mode from INFO to DEBUG. This is is determined by the following line in the log4j-server.properties file: log4j.rootLogger=INFO,stdout,R rerun the cassandra From the output, I find the erro

Categories : Cassandra

Brand new to Cassandra, having trouble understanding replication topology
There are a few reasons why you might not want to increase your RF from 3 to 4: Increasing your RF effectively multiplies your original data volume by that amount. Depending on your data volume and data density you may not want to incur the additional storage hit. RF > number of nodes will help you scale beyond one node's capacity. Depending on your consistency level you could experience a perfo

Categories : Cassandra

Low read throughput with cassandra (timeseries data)
What kind of compaction do you use? If you are having bad read latency from disks it mostly because of the number of SS Tables. My Suggestions: If you are looking for better read latency, i would suggest use Leveled compaction. Configure the SS Table size to avoid too many compactions. With leveled compaction you should get only have max number of reads as the levels. So the performance will

Categories : Cassandra

Export cassandra query result to a csv file
If I am understanding correctly you want to redirect your output to stdout? Put your cql command in a file. My files is called select.cql and contents are: select id from wiki.solr limit 100; Then issue the following and you get it to stdout: cqlsh < select.cql I hope this helps. From there on you can pipe it and add commas, remove headers etc.

Categories : Cassandra

Show a brief description of a column family in Cassandra
I'm not sure of a way to do it from within cqlsh, but from a command prompt you should be able to get that information by doing a nodetool cfstats: $ nodetool cfstats myKeyspace.myColumnFamily Keyspace: myKeyspace Read Count: 3 Read Latency: 3.552 ms. Write Count: 8 Write Latency: 0.321375 ms. Pending Tasks: 0 Table: myColumnFamily

Categories : Cassandra

Cassandra Column Limit
The maximum number of columns in a partition (row) is 2B. The default LIMIT in the output means cqlsh is limiting the number of results it shows to 10000. The default LIMIT in the output is explained on this page: http://www.datastax.com/documentation/cql/3.1/cql/cql_reference/select_r.html?scroll=reference_ds_d35_v2q_xj__specifying-rows-returned-using-limit In Cassandra 2.1.1, you can use query

Categories : Cassandra

how to solve/var/lib/cassandra/data/system/schema_columnfamilies/system-schema_columnfamilies-tmp-ic-131-Index.db file not exist in cassendra
I had the same problem and solved it by changing the ownership of some folders using the following command: sudo chown -R cassandra:cassandra /var/lib/cassandra/ After doing this cqlsh worked for me.

Categories : Cassandra

CQL select a column of composite key
In Cassandra 2.1 and later: create table users ( username text, id int, location map, value int, PRIMARY KEY (username, id)); insert into users (username, id, location, value) VALUES ('Alice', 12, {'city': 'Boston'}, 100); insert into users (username, id, location, value) VALUES ('Tom', 13, {'city': 'New York'}, 200); insert into users (username, id, location, value) VALUES ('Bill', 22, {'state

Categories : Cassandra

Replica placement in multiple data center in cassandra
For simplicity, let's use a 2-DC example instead of 3. Yes this diagram shows classic nodes, not vnodes, from http://www.datastax.com/docs/1.0/cluster_architecture/replication. NetworkTopologyStrategy moves clockwise, placing replicas spanning two data centers, each with a replication factor of 2. LOCAL_QUORUM consistency allows the write operation to the second data center to be asynchronous.

Categories : Cassandra

Should Cassandra store derived value?
Assuming your 3 variables are examples not really what you are storing, it is a simple question of where you need better performance: retrieval or insertion/indexing. If you are doing data ingestion once a week you are probably not bottlenecking here so I would move as much calculation as possible here

Categories : Cassandra

Cassandra cluster creating a schema appears to bring all nodes down?
Well if anyone is interested - I solved this by changing the snitch to PropertiesFileSnitch and deleted all the old data and restarted cassandra and things worked seamlessly. If anyone can shed some light as to why RackInferringSnitch didn't work that'd be appreciated. Cheers

Categories : Cassandra

Query results not ordered despite WITH CLUSTERING ORDER BY
"why I still get data in random order, though CLUSTERING ORDER BY is specified in posts?" This is because ORDER BY only works for rows within a particular partitioning key. So in your case, if you wanted to see all of the posts for a specific user like this: SELECT * FROM posts WHERE userid=1; That return your results ordered by time, as all of the rows within the userid=1 partitioning key wo

Categories : Cassandra

Max value for TTL in cassandra
The maximum TTL is actually 20 years. From org.apache.cassandra.db.ExpiringCell: public static final int MAX_TTL = 20 * 365 * 24 * 60 * 60; // 20 years in seconds I think this is verified along both the CQL and Thrift query paths.

Categories : Cassandra

How to prevent Cassandra 2.0.11 from running out of memory on startup?
This is a bug addressed by https://issues.apache.org/jira/browse/CASSANDRA-8116. It can be fixed in 2.0.11 by setting the rpc_max_threads setting to a value other than the default value of Integer.MAX_VALUE. The HsHA server was changed and now uses the rpc_max_threads values to allocate handlers per selector thread. Hence the OOM when it tries to allocate Integer.MAX_VALUE handlers

Categories : Cassandra

Insert multiple records at once in Cassandra
Cassandra does not (at this time) have stored procedures, but you should be able to accomplish this with a batch statement. Essentially you should be able to encapsulate multiple INSERTs inside of BEGIN BATCH and APPLY BATCH statements. This example is from the DataStax documentation on batch operations. BEGIN BATCH INSERT INTO purchases (user, balance) VALUES ('user1', -8) USING TIMESTAMP 19

Categories : Cassandra

Network aware snitches
Check the list of snitches available for Cassandra. I believe the only non "network aware" switch is the SimpleSnitch. From the descriptions given, all of the other snitches should be "network aware." As for the EC2Snitch supporting multiple datacenters, this is from the DataStax documentation: Use with Amazon EC2 in a single region. Use the EC2Snitch for simple cluster deployments on

Categories : Cassandra

datastax cassandra java driver batch delete performance behavior
Writes and deletes are the same thing so you should expect the same performance characteristics. I would expect some slight benefits from batching but normal async operations should be just as fast.

Categories : Cassandra

Cassandra Spark job submission
The current release, DataStax Enterprise 4.5, supports dse spark-class instead of dse spark-submit: http://www.datastax.com/documentation/datastax_enterprise/4.5/datastax_enterprise/spark/sparkStart.html?scroll=sparkStart__spkShrkLaunch

Categories : Cassandra

"All host(s) tried for query failed" Error
Change rpc_address: 0.0.0.0 broadcast_rpc_address: 1.2.3.4 (Should not be 0.0.0.0) . for Cassandra version 2.1.10 Also for any further issue read cassandra.yaml file . lot of things are self explanatory.

Categories : Cassandra

cassandra insert+update same key in single batch
You are seeing the result of several properties of the Cassandra Database. There is no difference between inserts and updates in a Cassandra database. Cassandra follows a Last Write Wins (LWW) policy, that is the last change (by timestamp) to a given cell is the value of that cell. On tie's the higher value is selected. Batches in Cassandra are by default applied with the same timestamp for ever

Categories : Cassandra

What is better to use (CqlConnection and CqlCommand) or (Cluster and Session)
Use the cluster and session objects in the DataStax driver DataStax drivers provide critical functionality for enterprise cassandra apps, including configurable load balancing policies, automatic failover, retry policy, and tunability. These features are exposed via the cluster and session objects. Notice that CqlConnection and CqlCommand are not even mentioned in the DataStax documentation. Th

Categories : Cassandra

Cassandra upgrade from 2.0 to 2.1 with hsha setting giving outofmemory error
The default unlimited rpc_max_threads is causing this. See https://issues.apache.org/jira/browse/CASSANDRA-8116 for details - with HSHA enabled, it is essential to set rpc_max_threads to something reasonable for your use case. https://github.com/apache/cassandra/blob/cassandra-2.1/conf/cassandra.yaml#L430-L434

Categories : Cassandra

Cassandra Nagios plugins
The Nagios Core version 3 manual can be found here: http://library.nagios.com/library/products/nagioscore/manuals/ Instead of performing steps 5 and 6 in the pdf you attached, you will have to add the server, the command, and the service check to the Nagios .cfg files manually. Create the host object for the server using this page: http://nagios.sourceforge.net/docs/nagioscore/3/en/objectdefinit

Categories : Cassandra

Cassandra keyspace for counters
Sorry you had trouble with the instructions. The instructions need to be changed to make it clear that this is just an example and improved by changing RF to 3, for example. Using a keyspace for a single data center and single node cluster is not a requirement. You need to keep counters in separate tables, but not separate keyspaces; however, keeping tables in separate keyspaces gives you the fl

Categories : Cassandra

Does Cassandra support a percentage replication?
No, Cassandra use only the replication factor as number nodes -- a percentage does not necessarily makes sense -- what if I choose 35% and I have a 4 nodes cluster? Each node can own a 25% data and so the replication can be either 1 node (25%) or two nodes (50%) but no one match my specification.

Categories : Cassandra

Cassandra CQL searching for element in list
To directly answer your question, yes there is a way to accomplish this. As of Cassandra 2.1 you can create a secondary index on a collection. First, I'll re-create your column family definition (while adding a definition for upload_timestamp timeuuid) and put some values in it. aploetz@cqlsh:stackoverflow> SELECT * FROM videos ; video_id | upload_timestamp

Categories : Cassandra

Results pagination in Cassandra (CQL)
Try using the token function in CQL: http://www.datastax.com/documentation/cql/3.0/cql/cql_using/paging_c.html Another suggestion, if you are using DSE, solr supports deep paging: https://cwiki.apache.org/confluence/display/solr/Pagination+of+Results

Categories : Cassandra

What happen if I didn't put all the C* hosts in DevCenter?
Here's what will happen: DevCenter will use the Whitelist load balancing policy 1 to connect to the provided nodes While DevCenter uses the DataStax Java driver as the underlying connector, it does use the above mentioned load balancing policy to reduce the time needed to obtain connections (instead of the default driver's load balancing policy which requires discovering all the nodes in the cl

Categories : Cassandra

Why is data corruption happen in Cassandra 1.2?
C* 1.2 supports column deletions for cql tables - http://www.datastax.com/documentation/cql/3.0/cql/cql_using/use_delete.html However, I do not see anything wrong from the procedure you described to re-create a new table without your column. Here are some steps to go forward. Assumptions - The corruption you are seeing is in the new table not the old one (do they have the same name?) You have

Categories : Cassandra

Cassandra Timestamp+Counter
Just make your primary key (user,timestamp). This will make a separate partition for each user and each counter in the partition will be ordered by the timestamp of last event. create table counts( user varchar, last_event timestamp, event_count counter, primary key (user, last_event) ); Your partitions will look like [username -> [time1, counter] , [time

Categories : Cassandra




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.