cassandra

Key space name issue with creating table in cassandra

ぃ、小莉子 提交于 2020-02-08 07:10:52
问题 I have an existing key space 'emsSdk'. I need to create a table in the mentioned key space through java. So i followed the code using spark-cassandra-connector. Code is provided below ession.execute("CREATE TABLE emsSdk.activity (project_party_id TEXT, error_count TEXT," + " lock_version TEXT, record_status_id TEXT, error_type TEXT, error_message TEXT, file TEXT, release_stage_id TEXT, " + "line_no TEXT, uid TEXT PRIMARY KEY, activity_type_id TEXT, created_at TEXT," + "project_name TEXT,

Cassandra SELECT DISTINCT and timeout issue

偶尔善良 提交于 2020-02-08 06:18:58
问题 When running the following CQL query: SELECT DISTINCT partition_key FROM table_name; This is supposedly meant to return the list of partition keys that are in use for the given table. However, with the default timeout settings of 10s, it always times out: 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':

Cassandra SELECT DISTINCT and timeout issue

白昼怎懂夜的黑 提交于 2020-02-08 06:18:04
问题 When running the following CQL query: SELECT DISTINCT partition_key FROM table_name; This is supposedly meant to return the list of partition keys that are in use for the given table. However, with the default timeout settings of 10s, it always times out: 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':

实战-Cassandra之压测

廉价感情. 提交于 2020-02-07 14:14:49
执行前 [root@node1 bin]# /data/cass/bin/nodetool status Datacenter: datacenter1 ======================= Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Tokens Owns (effective) Host ID Rack UN 192.168.56.10 172.45 KiB 1 33.3% 8da208d9-7ddb-48c1-95f4-2a041dd51239 rack1 UN 192.168.56.12 220.89 KiB 1 33.3% 3f290c85-704e-4201-b708-d0e0a024ce50 rack1 UN 192.168.56.13 176.04 KiB 1 33.3% 8b43630e-5a8d-4ba8-8806-d2ad5f951161 rack1 压测:/data/cass/tools/bin/cassandra-stress write n=1000000 -rate threads=50 -node 192.168.56.10 执行后 [root@localhost ~]# /data/cass/bin/nodetool status

Cassandra nodetool详解

删除回忆录丶 提交于 2020-02-06 18:40:43
Cassandra自带一个nodetool工具,安装目录/bin/nodetool nodetool help:帮助信息 [cassandra@node3 bin]$ ./nodetool help usage: nodetool [(-p <port> | --port <port>)] [(-h <host> | --host <host>)] [(-pwf <passwordFilePath> | --password-file <passwordFilePath>)] [(-pw <password> | --password <password>)] [(-u <username> | --username <username>)] <command> [<args>] The most commonly used nodetool commands are: assassinate Forcefully remove a dead node without re-replicating any data. Use as a last resort if you cannot removenode bootstrap Monitor/manage node's bootstrap process cleanup Triggers the immediate cleanup

Cassandra: Create a partitioned table without including the partitioned column name in primary key

China☆狼群 提交于 2020-02-06 07:55:47
问题 I want to create a partitioned table without including the partitioned column name in primary key. I am not getting any clue how to create it because most of the examples declaring the clustering column in the primary key section. I am not sure whether it is doable in Cassandra or not hence seeking some help. CREATE TABLE crossfit_gyms_by_city ( country_code text, state_province text, city text, gym_name text, year int, month int, day int); My requirement is : The table should be able to

cassandra读写数据

蹲街弑〆低调 提交于 2020-02-05 08:57:31
cassandra读写数据 写 写一致性级别 cassandra的可调一致性级别意味着你可以在查询中指定所需的写操作一致性,一致性级别越高,说明需要更多的副本节点相应才能认为写操作完成,更高的一致性级别还可能带来可用性的下降,因为必须有更多的节点可以使用,写操作才能成功 一致性级别 含义 ANY 返回到客户端之前,确保这个值写入一个副本节点,提示可以算作一个写操作 ONE, TWO, THREE 返回到客户端之前, 确保至少写入1个,2个或3个节点的提交日志和memtable LOCAL_ONE 与ONE类似,不过有额外要求:响应节点应当在本地数据中心 QUORUM 确保至少大多数副本((副本因子/2)+1)接收了写操作 LOCAL_QUORUM 与QUORUM类似,但响应节点应当在本地数据中心 EACH_QUORUM 确保每个数据中心有QUORUM个节点响应 ALL 返回到客户端之前,根据副本因子指定的节点数,确保相应数目的节点接收了写操作,即使只有一个副本没有写操作,操作也会失败 查看默认的一致性级别 cassandra写路径 写路径描述如何处理客户端发起的数据修改查询,最终将把数据存储在磁盘上 客户端向一个cassandra节点发起一个写查询时,写路径开始,这个节点将作为这个请求的协调器。协调器节点使用分区器根据键空间的副本因子确定集群中的哪些节点是副本节点

Cassandra - CQL OR Operator

巧了我就是萌 提交于 2020-02-05 08:27:08
问题 I am trying to learn cassandra. I am using windows community edition (2.0) . My table schema is: CREATE TABLE test.TestTable2 ( PK1 int, PK2 int, CK3 int, CK4 int, Dump text, PRIMARY KEY ((PK1,PK2,CK3),CK4) ); I want to query the dump value for (PK1=1 and Pk2 =2 and Ck3 =5 and CK4 in (4,5)) or (PK1=2 and Pk2 =2 and Ck3 =5 and CK4 in (4,5)) . I am unable to use or condition , can someone suggest how can I do that in CQL 回答1: There is no support for OR operator: what you'd like to do is hit 2

relevance search in Solr

我的未来我决定 提交于 2020-02-02 14:37:24
问题 I am using DSE5.0.2 version and Solr ( integrated with dse) . I have to do relevance search using solr on the below tables/ data . I have a table in cassandra on which we have created a solr core - CREATE TABLE fullsearch ( launchedtime bigint, hashtag text, solr_query text, PRIMARY KEY (launchedtime)) Now we have created a solr core and searching on the field hashtag . but i want those result which contains max no of hashtag i am searching . for ex : - if data in cassandra is - launchedtime

relevance search in Solr

你离开我真会死。 提交于 2020-02-02 14:35:08
问题 I am using DSE5.0.2 version and Solr ( integrated with dse) . I have to do relevance search using solr on the below tables/ data . I have a table in cassandra on which we have created a solr core - CREATE TABLE fullsearch ( launchedtime bigint, hashtag text, solr_query text, PRIMARY KEY (launchedtime)) Now we have created a solr core and searching on the field hashtag . but i want those result which contains max no of hashtag i am searching . for ex : - if data in cassandra is - launchedtime