cqlsh

Select a specific record in Cassandra using cql

拜拜、爱过 提交于 2020-01-05 07:31:24
问题 This is the schema I use: CREATE TABLE playerInfo ( key text, column1 bigint, column2 bigint, column3 bigint, column4 bigint, column5 text, value bigint, PRIMARY KEY (key, column1, column2, column3, column4, column5) ) WITH COMPACT STORAGE AND bloom_filter_fp_chance=0.010000 AND caching='KEYS_ONLY' AND comment='' AND dclocal_read_repair_chance=0.000000 AND gc_grace_seconds=864000 AND read_repair_chance=0.100000 AND replicate_on_write='true' AND populate_io_cache_on_flush='false' AND

CQLSH is not recognized in google cloud datastax cluster nodes

元气小坏坏 提交于 2020-01-05 04:21:37
问题 I have deployed a 4 node datastax cluster in GCP. I can ssh into each of the VM nodes but cqlsh is not recognized.Can you please help me to understand where I am going wrong error: Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")}) 回答1: If your cluster is working correctly, then the nodes must know about each other by their own IPs (internal or external). So Cassandra isn't configured

Is there a way to effectively count rows of a very huge partition in Cassandra?

删除回忆录丶 提交于 2020-01-05 04:07:12
问题 I have very huge Cassandra table containing over 1 billion records. My primary key forms like this: " (partition_id, cluster_id1, cluster_id2) ". Now for several particular partition_id, I have too many records that I can't run row count on these partition keys without timeout exception raised. What I ran in cqlsh is: SELECT count(*) FROM relation WHERE partition_id='some_huge_partition'; I got this exception: ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for

Can't export Cassandra table using Python

此生再无相见时 提交于 2020-01-04 08:15:10
问题 I am trying to export Cassandra table to CSV format using Python. But I couldn't do it. However, I am able to execute 'select' statement from Python. I have used the following code: from cassandra.cluster import Cluster cluster = Cluster () session = cluster.connect('chandan') ### 'chandan' is the name of the keyspace ## name of the table is 'emp' session.execute(""" copy emp (id,name) to 'E:\HANA\emp.csv' with HEADER = true """ ) print "Exported to the CSV file" Please help me in this regard

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 )

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 cqlsh Unable to connect to any servers - 127.0.0.1:9160 (closed)> is already closed

我的梦境 提交于 2019-12-30 02:43:27
问题 I installed Cassandra on OSX. When trying to run cqlsh from /bin/, I get the following error: > Connection error: ('Unable to connect to any servers', {'127.0.0.1': > ConnectionShutdown('Connection <AsyncoreConnection(4522252560) > 127.0.0.1:9160 (closed)> is already closed',)}) I had difficulty installing Cassandra, and had used brew install cassandra, installed DSE from datastax, and downloaded a binary from Apache. 回答1: I think the issue was the result of having a previous installation

Chinese language in Cassandra

淺唱寂寞╮ 提交于 2019-12-29 09:59:08
问题 I used the chinese letters in Cassandra and it seems the data is entered properly like below, SELECT * FROM user; user_id | user_name | user_phone ---------+--------------+------------- 23 | uSer23, | 12345678910 5 | uSer5^ | 12345678910 28 | uSer28名 | 12345678910 10 | uSer10- | 12345678910 16 | uSer16{ | 12345678910 13 | uSer13= | 12345678910 30 | uSer30一些 | 12345678910 11 | uSer11_ | 12345678910 1 | uSer1@ | 12345678910 19 | uSer19" | 12345678910 8 | uSer8( | 12345678910 0 | uSer0! |

specify cqlsh output timezone

三世轮回 提交于 2019-12-29 06:57:31
问题 I have a table in cassandra with a datatype of timestamp. i am using cqlsh to get data out of the database and wanted to change the output format for how my timestamp column output looks like. I researched around and found that i can change the timestamp output format by making changes to the following file: ~/.cassandra/cqlshrc But i learnt that the only change i can make is the time elements, i cannot make the output to display my timestamps in a different timezone(say UTC). It always