首页 > 解决方案 > DSBulk 加载程序 1.8 版:加载和连接到 Apache Cassandra 时出错

问题描述

我手动安装了 Apache Cassandra 和 DSBulk 加载程序,一切正常,但是当我尝试使用 DSBulk 加载数据时,似乎是 db 和 DSBulk 之间的连接问题。有人可以告诉我发生了什么,我该如何解决?奇怪,第一次看到这个错误。直到今天,这从未发生在我身上。

这里的错误:

dsbulk load -url test.csv -k key1 -t tab1  -delim "," -header false 
Operation directory: /home/User/Desktop/logs/LOAD_20210505-115826-488329
[driver] Error connecting to Node(endPoint=/127.0.0.1:9042, hostId=null, hashCode=73f04b1b), trying next node (ConnectionInitException: [driver|control|id: 0x435f7dc8, L:/127.0.0.1:57946 - R:/127.0.0.1:9042] Protocol initialization request, step 1 (OPTIONS): unexpected failure (java.lang.IllegalArgumentException: Unsupported request opcode: 0 in protocol 6))
Operation LOAD_20210505-115826-488329 failed: Could not reach any contact point, make sure you've provided valid addresses (showing first 1 nodes, use getAllErrors() for more): Node(endPoint=/127.0.0.1:9042, hostId=null, hashCode=73f04b1b): [com.datastax.oss.driver.api.core.connection.ConnectionInitException: [driver|control|id: 0x435f7dc8, L:/127.0.0.1:57946 - R:/127.0.0.1:9042] Protocol initialization request, step 1 (OPTIONS): unexpected failure (java.lang.IllegalArgumentException: Unsupported request opcode: 0 in protocol 6)].
   Suppressed: [driver|control|id: 0x435f7dc8, L:/127.0.0.1:57946 - R:/127.0.0.1:9042] Protocol initialization request, step 1 (OPTIONS): unexpected failure (java.lang.IllegalArgumentException: Unsupported request opcode: 0 in protocol 6).
     Caused by: Unsupported request opcode: 0 in protocol 6.

尝试重新安装 DSBulk 后,它仍然存在。也许是java发生了什么?

我认为这是第一次发帖,这个问题很麻烦。

谢谢

根据收到的第一个答案

  1. nodetool 状态正常

    数据中心:datacenter1

    |/ State=Normal/Leaving/Joining/Moving
    --  Address    Load        Tokens  Owns (effective)  Host ID                               Rack 
    UN  127.0.0.1  139,99 KiB  16      100,0%            b3d1b971-59e0-43c7-9392-8dfe1fc2fdeb  rack1```
    
    
    
  2. listen_address 和 rpc_address 都是:localhost

标签: ubuntucassandradatastax-enterprisecassandra-3.0dsbulk

解决方案


所以当我看到这样的事情时:

Error connecting to Node(endPoint=/127.0.0.1:9042

...几乎总是因为两件事之一。

  1. 节点未运行。用 验证nodetool status

  2. 本地节点上的cassandra.yaml具有listen_address或未rpc_address设置为localhost。请注意,一旦 Cassandra 正在侦听特定 IP,尝试使用localhost(甚至在本地)访问它将会失败。所以仔细检查地址,然后尝试。

编辑:

我认为你遇到了这个:

https://datastax-oss.atlassian.net/browse/JAVA-2936

无论哪种方式,这都需要明确设置本机协议版本:

advanced.protocol.version=V5

推荐阅读