插入 table emp1234 但在 cassandra 中出现错误

inserting in table emp1234 but got an error in cassandra

这是我试过的:

emp1234(user_id,age,city,country,height,mobile_no,name,sex,state,weight) FROM '/tmp/user.csv' WITH HEADER = FALSE;

但是returns出现以下错误:

error - Failed to import 17 rows: WriteTimeout - Error from server: code=1100 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed out - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}, will retry later, attempt 1 of 5

最可能的原因是密钥空间的复制因子设置中的 DC 名称与集群中的不同。

通过nodetool状态获取DC名称,检查键空间设置中的名称(通过DESCRIBE keyspace_name;),它们应该相同,包括字符大小写。如果它们不同,请通过

更改复制因子
alter KEYSPACE test WITH replication = {'class': 'NetworkTopologyStrategy', 'DC_name': X};