【发布时间】:2017-07-29 23:41:54
【问题描述】:
我正在尝试将数据插入 Cassandra。我有一个 1M4 整数列表,我想将其插入具有以下架构的表中:
CREATE TABLE IF NOT EXISTS my_table (
node_id bigint,
screen_name text,
centrality float,
friend_follower_id bigint,
is_friend boolean,
is_follower boolean,
PRIMARY KEY ((node_id), friend_follower_id));
要插入数据,我做了以下操作:
prepared_statement = session.prepare("INSERT INTO {0} (node_id, screen_name, friend_follower_id, centrality, is_follower) VALUES ({1}, {2}, ?, {3}, true)".format("met_table", author_id, author_username, 0.0)
execute_concurrent_with_args(session, prepared_statement, zip(followers))
错误如下:
cassandra.WriteTimeout: Error from server: code1100 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed -out received only 0 responses." info={'consistency': LOCAL_ONE, 'received_response':0, 'required_response':1}
在写入大量数据时如何避免超时?
【问题讨论】:
标签: python python-3.x cassandra timeout datastax