cqlsh

cassandra cql中的限制有什么影响

当执行像select * from table limit 10这样的cqlsh查询时,cassandra是扫描整个表并只返回前10条记录,还是可以精确定位整个数据中心的前10条记录而不扫描整个表?... »

CQLSH 在 google cloud datastax 集群节点中无法识别

我在 GCP 中部署了一个 4 节点的 datastax 集群。我可以 ssh 进入每个 VM 节点,但无法识别 cqlsh。请您帮我了解我哪里出错了 错误: Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1... »

Cassandra NoHostAvailable:CQLSH 中的错误

我刚刚在 cassandra 中创建了我的表。我试图将数据插入表中,但出现此错误: cqlsh:test> INSERT into qw (id, user, pass, email, phoneNum) VALUES (1, 'scman', '123','sc@gmaail.com','123-456-7890'); NoHostAvailable: 我检查了我的服务器是否正在运... »

二级索引上的 Cassandra 查询:ReadTimeout:code=1200

我正在使用 [cqlsh 5.0.1 |卡桑德拉 2.2.1 | CQL 规范 3.3.0 |本机协议 v4] 版本。我有 2 个节点 cassandra 集群,复制因子为 2。 $ nodetool status test_keyspace Datacenter: datacenter1 ======================= Status=Up/Down |/ State=Norma... »

cassandra 中的轻量级事务

我有两个关于 cassandra 中的 LightWeight Transcation 的问题, 1) 将为以下两个查询提供什么级别的锁定(行?列?表?级别锁定)? i) INSERT INTO user (user_id, user_name, user_phone, timestamp) VALUES(1,'uma', 9003934069, 4331312423232) IF EXIST... »

安装 cassandra 时访问被拒绝

我正在尝试在 Windows 10 上安装 cassandra,但由于上述错误而失败。我已经设置了 JAVA_HOME 和 cassandra 路径。还安装了 Python。我还尝试更改 cassandra.yaml listen_address: 127.0.0.1 和 rpc_address: 127.0.0.1 但没有任何效果。完整的错误如下: C:\Users\Sudarshan>... »

从表中选择数据的where条件

我正在尝试从 cassandra 数据库中检索分区键值为奇数的数据。 现在我有主键 p 的表 t。 我试过了 Select * from t where token(p)%2=1; 但我收到了错误消息: SyntaxException:第 1:44 行在输入“%”处没有可行的替代方案(...from videos_by_tag where token(tag)[%]...) ... »

卡桑德拉 | AttributeError - 'NoneType' 对象没有属性 'is_up'

我在 Cassandra 数据库中有两个结构相同的表。它们都在同一个键空间中。我需要将数据从一个表移动到另一个表。我使用 COPY/TO 创建了一个标准 CSV 文件,现在我想在另一个 Cassandra 表中使用 COPY/FROM 上传内容。但是,我收到以下错误: Failed to import 1926 rows: AttributeError - 'NoneType' object ha... »

在 CQLSH 中使用“-f”标志运行 query.cql 文件的问题

我正在使用 cqlsh 通过 BATCH 查询向 Cassandra 添加数据,我可以使用“-e”标志通过查询加载数据,但不能从使用“-f”标志的文件中加载数据。我认为这是因为文件是本地的,而 Cassandra 是远程的。详情如下: 这是我的查询示例(显然要插入更多行): BEGIN BATCH; INSERT INTO keyspace.table (id, field1) VALUES ... »

如何将 cassandra 集群降级为独立集群

我已经设置了具有两个节点 node1 和 node2 的 cassandra 集群。 node1 是种子节点。 我想从集群中停用 node2。 系统认证配置 KEYSPACE system_auth WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1': '2'} AND durable_writes = true; ... »

无法使用 Python 导出 Cassandra 表

我正在尝试使用 Python 将 Cassandra 表导出为 CSV 格式。但我做不到。但是,我可以从 Python 执行“选择”语句。我使用了以下代码: from cassandra.cluster import Cluster cluster = Cluster () session = cluster.connect('chandan') ### 'chandan' is the nam... »

CQLSH 协议错误

我有一个 cqlsh 错误 当我输入 cqlsh 启动 cassandra shell 时,cassandra 服务器已经启动了这个错误 Connection error: ('Unable to connect to any servers', {'127.0.0.1': ProtocolError("cql_version '3.3.1' is not supported by remote... »

设置分区键列大小

我有一个近期历史表。它应该只关心插入到其分区 (user_id) 中的最后 100 个宽行。 如果您要插入 100 条之后的记录,那么我们应该期望它会覆盖最旧的数据。 我的桌子是这样的 CREATE TABLE IF NOT EXISTS user_history ( user_id text, ts timeuuid, ... »

cqlsh 2 中是否有明确的“显示键空间”等价物?

我可以使用什么 cqlsh 命令来快速查看集群中的键空间? cqlsh 不提供show keyspaces 和describe cluster 没有我想要的简洁。 我正在使用以下规范: cqlsh 2.2.0、Cassandra 1.1.10、CQL 规范 2.0.0、Thrift 协议 19.33.0... »

Cassandra CQL - 将 system.local 表中的 release_version 列转换为 int

我正在用 cql 编写一个查询,检查 Cassandra 的发布版本是否大于或等于 3.11.10。 select * from system.local where release_version >= '3.11.10' 由于 release_version 是数据类型文本,这将不起作用,我找不到获取此值的子字符串或将值转换为 int 的方法。 我无法为此创建函数,因为我无法在系统表上... »

Cassandra Cqlsh 不工作

我刚刚开始使用 Cassandra(自制安装)3.7 版和 cqlsh 5.0.1 版。 , OS X El Capitan Cassandra 启动良好,集群立即运行。 Cqlsh 不工作(在任何节点上)并发出以下错误: Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(61, "Trie... »