cassandra-3.0

High Availability in Cassandra

末鹿安然 提交于 2019-12-02 14:53:25
问题 1) I have 5 node cluster (172.30.56.60, 172.30.56.61, 172.30.56.62, 172.30.56.63, 172.30.56.129) 2) I created a keyspace with Replication Factor as 3 write consistency as 3 , I have inserted a row in a table with the partition as '1' like below, INSERT INTO user (user_id, user_name, user_phone) VALUES(1,'ram', 9003934069); 3) I verified the location of the data using the nodetool getendpoints utility and observed that the data is copied in three nodes 60, 129 and 62. ./nodetool getendpoints

Prevent tombstones creation

限于喜欢 提交于 2019-12-02 12:33:02
问题 I need to perform an insert to Cassandra table without creating tombstones for any column. I am using a query similar to this : insert into my_table(col1,col2,col3) values(val1,val2,null) where col1, col2 and col3 are all the attributes in my_table. Is there any other solution or workaround to prevent tombstone creation for say col3 apart from passing only non-null attributes in our query and letting cassandra set the remaining attributes to null? 回答1: Don't include col3 in your insert and it

High Availability & Performance consideration with secondary index in Cassandra

北慕城南 提交于 2019-12-02 11:45:35
问题 I have a Set up with : 5 Cassandra node cluster with RF =3, I performed a secondary index for a column in the table 'user', 1) As per my study on Secondary Index using the link: https://www.datastax.com/dev/blog/cassandra-native-secondary-index-deep-dive I understood that secondary indexes will be stored in the local node. Does it mean that in the five node cluster only in one node the secondary index will be available? If not in the RF =3 for user table, In how many nodes the Secondary Index

Integrating Apache Cassandra with Apache Ignite

▼魔方 西西 提交于 2019-12-02 10:06:34
问题 I'm trying to integrate Apache Ignite with Apache Cassandra(3.11.2) as I want to use Ignite to cache the data present in my already existing Cassandra database. After going through the online resources, I've done the following till now: Downloaded Apache Ignite. Copied all the folders present in "libs/optional/" to "libs/"(I don't know which ones will be required for Cassandra). Created 3 xmls in the config folder i.e. "cassandra-config.xml", "connection-settings.xml" and "persistance

Cassandra 3.0 latency statistic incorrect

我怕爱的太早我们不能终老 提交于 2019-12-02 08:20:12
问题 I have setup new Cassandra 3.3 cluster. Then I use jvisualvm to monitor Cassandra read/write latency by using MBean (jmx metric). The result of read/write latency is always stable in all nodes for many weeks whereas read/write request in that cluster have normally movement (heavy or less in some day). As I use jvisualvm to monitor Cassandra 2.0 cluster. The read/write latency have normally behavior. It have movement depending on read/wire requests. I wonder that Why the read/write latency

High Availability & Performance consideration with secondary index in Cassandra

一个人想着一个人 提交于 2019-12-02 07:26:27
I have a Set up with : 5 Cassandra node cluster with RF =3, I performed a secondary index for a column in the table 'user', 1) As per my study on Secondary Index using the link: https://www.datastax.com/dev/blog/cassandra-native-secondary-index-deep-dive I understood that secondary indexes will be stored in the local node. Does it mean that in the five node cluster only in one node the secondary index will be available? If not in the RF =3 for user table, In how many nodes the Secondary Index table will be available? 2) How does the following two query differ in execution? CREATE TABLE user(

Cassandra 3 Java Driver build dynamic queries

让人想犯罪 __ 提交于 2019-12-02 07:10:57
问题 Is there a way to build dynamic queries by given parameters? public List getData(String title,Date dateFrom){ Statement statement = QueryBuilder.select() .all().from("test_database", "books"); if(dateFrom!=null){ //add clause to statement to find books from 'dateFrom' } } 回答1: Creating dynamic queries in Cassandra is kind of a code smell. Cassandra isn't really designed for "dynamic" queries, you should be designing tables based on specific query patterns that you need. Dynamic queries can

How to set the downgrading policy in Cassandra using nodejs

早过忘川 提交于 2019-12-02 06:16:42
I am not sure about setting the policy 'DowngradingRetryPolicy' in nodejs using Cassandra. policies : { loadBalancing : new cassandra.policies.loadBalancing.RoundRobinPolicy, retry: new cassandra.policies.retry.IdempotenceAwareRetryPolicy(new cassandra.policies.retry.RetryPolicy()) } }); This is how I set the IdempotenceAwareRetryPolicy policy and it is working as expected but How to set the ' DowngradingRetryPolicy ' policy in Cassandra using nodejs For reference adding the ruby implementation, https://datastax.github.io/ruby-driver/features/retry_policies/downgrading_consistency/ There is no

Cassandra 3 Java Driver build dynamic queries

巧了我就是萌 提交于 2019-12-02 05:34:57
Is there a way to build dynamic queries by given parameters? public List getData(String title,Date dateFrom){ Statement statement = QueryBuilder.select() .all().from("test_database", "books"); if(dateFrom!=null){ //add clause to statement to find books from 'dateFrom' } } Creating dynamic queries in Cassandra is kind of a code smell. Cassandra isn't really designed for "dynamic" queries, you should be designing tables based on specific query patterns that you need. Dynamic queries can quickly become messy since in Cassandra you'll have to make sure you're following the rules of the WHERE

determine node of a partition in Cassandra

孤者浪人 提交于 2019-12-02 05:27:59
问题 This is maybe a special question but is it possible to determine the node(s) of a partion key? example: I have a partition key id (int) and I'm using the default Partitioner(Murmur3Partitioner) with 3 nodes and replication factor "1". Can I determine the one node with id = 3? CREATE TABLE example_table ( id int, content text, PRIMARY KEY (id, content) ) 回答1: You can use nodetool getendpoints <keyspace> <table> <partition_key> or you can use select token(<partition_key>) from <table_name> and