首页 > 解决方案 > 使用 cqlsh 的 COPY 时连接所有副本失败

问题描述

我的 3 节点 Cassandra 集群使用 AWS 弹性负载平衡 (ELB) 部署在 AWS 上

当我运行以下命令时:

$cqlsh -u <userid> -p <pwd>  <ELB's ip> -f backup.cqlsh

在 backup.cqlsh 中:

COPY comm_hub.my_table TO 'my_table.csv' WITH PAGESIZE=10;

但是在导出了大约 200 行之后,我得到了

backup.cqlsh:1:
Error for (-429560303281209914, -419692349690315328):
Failed to connect to all replicas ['10.16.234.41', '10.16.233.40', '10.16.234.130'] for (-429560303281209914, -419692349690315328), errors:
['NoHostAvailable - (\'Unable to connect to any servers\', {\'10.16.234.41\': error(None, "Tried connecting to [(\'10.16.234.41\', 9042)]. Last error: timed out")})', 'NoHostAvailable - (\'Unable to connect to any servers\', {\'10.16.233.40\': error(None, "Tried connecting to [(\'10.16.233.40\', 9042)]. Last error: timed out")})', 'NoHostAvailable - (\'Unable to connect to any servers\', {\'10.16.234.130\': error(None, "Tried connecting to [(\'10.16.234.130\', 9042)]. Last error: timed out")})'] (will try again later attempt 1 of 5)

我错过了什么?

标签: cassandracqlsh

解决方案


我在本地集群中遇到了同样的问题,并通过设置解决了它NUMPROCESSES = 1

在您提供的示例中:COPY comm_hub.my_table TO 'my_table.csv' WITH PAGESIZE=10 AND NUMPROCESSES=1;


推荐阅读