cqlsh

Operation Time Out Error in cqlsh console of cassandra

爱⌒轻易说出口 提交于 2019-11-28 10:54:21
I have a three nodes Cassandra Cluster and I have created one table which has more than 2,000,000 rows. When I execute this ( select count(*) from userdetails ) query in cqlsh, I got this error: OperationTimedOut: errors={}, last_host=192.168.1.2 When I run count function for less row or with limit 50,000 it works fine. count(*) actually pages through all the data. So a select count(*) from userdetails without a limit would be expected to timeout with that many rows. Some details here: http://planetcassandra.org/blog/counting-key-in-cassandra/ You may want to consider maintaining the count

Inserting a hard-coded UUID via CQLsh (Cassandra)

ぐ巨炮叔叔 提交于 2019-11-27 22:55:29
问题 Would like to populate some static test data via a CQLsh script. This doesn't work: (device_id is UUID) insert into devices (device_id, geohash,name, external_identifier, measures, tags) values ('c37d661d-7e61-49ea-96a5-68c34e83db3a','9q9p3yyrn1', 'Acme1', '936', {'aparPower','actPower','actEnergy'},{'make':'Acme'}); Bad Request: Invalid STRING constant (c37d661d-7e61-49ea-96a5-68c34e83db3a) for device_id of type uuid I can't seem to find any CQL function to convert to proper type. Do I need

Can't connect to cassandra node from different host

你。 提交于 2019-11-27 20:41:05
I have a cassandra node at a machine. When I access cqlsh from the same machne it works properly. But when I tried to connect to it's cqlsh using "192.x.x.x" from another machine, I'm getting an error saying Connection error: ('Unable to connect to any servers', {'192.x.x.x': error(111, "Tried connecting to [('192.x.x.x', 9042)]. Last error: Connection refused")}) What is the reason for this? How can I fix it? Nicola Ferraro Probably the remote Cassandra node is not bound to the external network interface but to the loopback one (this is the default configuration). You can ensure this by using

Cassandra cqlsh - how to show microseconds/milliseconds for timestamp columns?

女生的网名这么多〃 提交于 2019-11-27 11:49:59
I'm inserting into a Cassandra table with timestamp columns. The data I have comes with microsecond precision, so the time data string looks like this: 2015-02-16T18:00:03.234+00:00 However, in cqlsh when I run a select query the microsecond data is not shown, I can only see time down to second precision. The 234 microseconds data is not shown. I guess I have two questions: 1) Does Cassandra capture microseconds with timestamp data type? My guess is yes? 2) How can I see that with cqlsh to verify? Table definition: create table data ( datetime timestamp, id text, type text, data text, primary

Cassandra cqlsh - connection refused

こ雲淡風輕ζ 提交于 2019-11-27 08:48:32
I've just started working with Cassandra (datastax), version 2.1.3 and cqlsh version 5.0.1. Cassandra starts up fine and the cluster is operational instantly. Cqlsh is not working (on any of the nodes) and emits the following 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")}) I have tried starting cqlsh up with the hosts own ip, other hosts ip, different ports yet the result remains the same - always connection refused. Ruba Try to change the rpc_address to point to the node's IP

Cassandra : CQLSH not displaying correct timezone

ε祈祈猫儿з 提交于 2019-11-27 08:45:29
问题 I have a table macrecord in cassandra as follows : macadd | position | record | rssi1 | timestamp -------------------+----------+--------+-------+--------------------- D8:C7:C8:45:52:20 | 21 | 25 | 0 | 2015-09-25 08:41:00+0000 I am inserting timestamp values using dateof(now()) however the problem is CQLSH is just displaying the default UTC time and not adding the timezone offet +0800 in my case. How can i display the correct timezone. I am on ubuntu 14.04 and my system time is correct. 回答1:

How to copy data from a Cassandra table to another structure for better performance

点点圈 提交于 2019-11-27 06:40:46
问题 In several places it's advised to design our Cassandra tables according to the queries we are going to perform on them. In this article by DataScale they state this: The truth is that having many similar tables with similar data is a good thing in Cassandra. Limit the primary key to exactly what you’ll be searching with. If you plan on searching the data with a similar, but different criteria, then make it a separate table. There is no drawback for having the same data stored differently.

Operation Time Out Error in cqlsh console of cassandra

北战南征 提交于 2019-11-27 03:53:47
问题 I have a three nodes Cassandra Cluster and I have created one table which has more than 2,000,000 rows. When I execute this ( select count(*) from userdetails ) query in cqlsh, I got this error: OperationTimedOut: errors={}, last_host=192.168.1.2 When I run count function for less row or with limit 50,000 it works fine. 回答1: count(*) actually pages through all the data. So a select count(*) from userdetails without a limit would be expected to timeout with that many rows. Some details here:

Export cassandra query result to a csv file

故事扮演 提交于 2019-11-27 01:13:46
问题 I'm new in cassandra, and I have to export the result of a specific query to a csv file. I found the COPY command, but (from what I understand) it allows you only to copy an already existing table to a csv file, and what I want is to copy directly the stdout of my query to the csv file. is there any way to do it with COPY command or with another way ? My command is style ( select column1, column2 from table where condition = xy ) and I'm using cqlsh . 回答1: If you don't mind your data using a

Can't connect to cassandra node from different host

允我心安 提交于 2019-11-26 20:28:48
问题 I have a cassandra node at a machine. When I access cqlsh from the same machne it works properly. But when I tried to connect to it's cqlsh using "192.x.x.x" from another machine, I'm getting an error saying Connection error: ('Unable to connect to any servers', {'192.x.x.x': error(111, "Tried connecting to [('192.x.x.x', 9042)]. Last error: Connection refused")}) What is the reason for this? How can I fix it? 回答1: Probably the remote Cassandra node is not bound to the external network