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,hashCode=73f04b1b): [com.datastax.oss.driver.api.core.connection.ConnectionInitException: [driver|control|id: 0x435f7dc8,step 1 (OPTIONS): unexpected failure (java.lang.IllegalArgumentException: Unsupported request opcode: 0 in protocol 6)].
   Suppressed: [driver|control|id: 0x435f7dc8,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

解决方法

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

Error connecting to Node(endPoint=/127.0.0.1:9042

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

  1. 节点没有运行。使用 nodetool status 进行验证。

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

编辑:

我想你遇到了这个:

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

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

advanced.protocol.version=V5