我在带有 Cassandra 4 数据库的 Python 3.8.10 中使用cassandra-driver (版本 3.25.0)。有时在向数据库发出请求时,我会收到以下错误。我已将相关部分粘贴到下面的堆栈跟踪中。
File "XXXXX.py", line 17, in get_row
session = cluster.connect(keyspace)
File "cassandra/cluster.py", line 1667, in cassandra.cluster.Cluster.connect
File "cassandra/cluster.py", line 1703, in cassandra.cluster.Cluster.connect
File "cassandra/cluster.py", line 1690, in cassandra.cluster.Cluster.connect
File "cassandra/cluster.py", line 3488, in cassandra.cluster.ControlConnection.connect
File "cassandra/cluster.py", line 3533, in cassandra.cluster.ControlConnection._reconnect_internal
cassandra.cluster.NoHostAvailable: ('Unable to connect to any servers', {'X.X.X.X:9042': ConnectionShutdown('CRC mismatch on header 8522. Received 80c00", computed 29cd26.')})
可能每向数据库发出约 100 个请求就不一定频繁。我在 Cassandra 集群中只有一个节点设置。我不确定为什么 CRC 校验和会失败。