gpt4 book ai didi

cassandra - 从 CQL 导出数据时出现 RPC 超时错误

转载 作者:行者123 更新时间:2023-12-04 17:50:02 25 4
gpt4 key购买 nike

我正在尝试使用 CQL 客户端从 cassandra 导出数据。一个列族大约有 100000 行。当我使用 COPY TO 命令将 dta 复制到 csv 文件时,出现以下 rpc_time out 错误。

copy mycolfamily to '/root/mycolfamily.csv'
Request did not complete within rpc_timeout.

我正在运行:
[cqlsh 3.1.6 | Cassandra 1.2.8 | CQL spec 3.0.0 | Thrift protocol 19.36.0]
如何增加 RPC 超时限制?

我尝试添加 rpc_timeout_in_ms: 20000 (默认值为 10000)在我的 conf/cassandra.yaml 中文件。但是在重新启动 cassandra 时,我得到:
[root@user ~]# null; Can't construct a java object for tag:yaml.org,2002:org.apache.cassandra.config.Config; exception=Cannot create property=rpc_timeout_in_ms for JavaBean=org.apache.cassandra.config.Config@71bfc4fc; Unable to find property 'rpc_timeout_in_ms' on class: org.apache.cassandra.config.Config
Invalid yaml; unable to start server. See log for stacktrace.

最佳答案

COPY命令当前对 SELECT 执行相同的操作与 LIMIT 99999999 .因此,当您的数据增长时,它最终会超时。这是导出功能;

https://github.com/apache/cassandra/blob/trunk/bin/cqlsh#L1524

我在生产中做同样的导出。我正在做的是以下内容;

  • make select * from table where timeuuid = someTimeuuid limit 10000
  • 将结果集写入带有 >> 模式的 csv 文件
  • 相对于最后一个 timeuuid 进行下一个选择

  • 您可以通过以下 cqlsh 命令在 cqlsh 中使用管道命令
    echo "{$cql}" | /usr/bin/cqlsh -u user -p password localhost 9160 > file.csv

    关于cassandra - 从 CQL 导出数据时出现 RPC 超时错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18872422/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com