【发布时间】:2014-05-08 00:25:22
【问题描述】:
我们目前正在使用 Cassandra 在单节点集群上测试应用程序开发。目前,我们有一个非常庞大的数据集,其中包含大约 7000 万行文本,我们希望将其转储到 Cassandra 中。
我们已经尝试了以下所有方法:
- 使用 python Cassandra 驱动逐行插入
- Cassandra 的复制命令
- 将 sstable 的压缩设置为无
我们已经探索了 sstable 批量加载程序的选项,但我们没有合适的 .db 格式。我们要加载的文本文件有 70M 行,如下所示:
2f8e4787-eb9c-49e0-9a2d-23fa40c177a4 the magnet programs succeeded in attracting applicants and by the mid-1990s only #about a #third of students who #applied were accepted.
我们打算插入的列族具有以下创建语法:
CREATE TABLE post (
postid uuid,
posttext text,
PRIMARY KEY (postid)
) WITH
bloom_filter_fp_chance=0.010000 AND
caching='KEYS_ONLY' AND
comment='' AND
dclocal_read_repair_chance=0.000000 AND
gc_grace_seconds=864000 AND
index_interval=128 AND
read_repair_chance=0.100000 AND
replicate_on_write='true' AND
populate_io_cache_on_flush='false' AND
default_time_to_live=0 AND
speculative_retry='99.0PERCENTILE' AND
memtable_flush_period_in_ms=0 AND
compaction={'class': 'SizeTieredCompactionStrategy'} AND
compression={};
问题: 将数据加载到即使是简单的列族也需要很长时间——插入的 30M 行需要 5 小时。我们想知道是否有任何方法可以加快这一速度,因为将 70M 行的相同数据加载到 MySQL 中的性能在我们的服务器上大约需要 6 分钟。
我们想知道我们是否遗漏了什么?或者,如果有人能指出我们正确的方向?
非常感谢!
【问题讨论】:
-
当您尝试 CQL
COPY命令时发生了什么? -
插入 70M 行大约需要 10 个小时。 (10K/分钟)