How to copy cassandra data from one cluster to another

后端 未结 3 1035
执笔经年
执笔经年 2021-01-21 21:27

I Have 2 cassandra clusters, on different datacenter (note that these are 2 different clusters, NOT a single cluster with multidc), and both clusters have the same keyspace and

3条回答
  •  自闭症患者
    2021-01-21 22:12

    Time to time I also need to copy data from one cassandra cluster to another. I use this tool https://github.com/masumsoft/cassandra-exporter. export.js script exports data to a json files, import.js script imports exported data to a cassandra. You can do it for all tables in specified keyspace or for a particular table only. Target keyspace and tables should exist before import.

    In js script you can adjust batch size and readTimeout if you get "read timeout error".

    UPDATE: After a hint by Alex Ott I tried DSBulk tool. It works great but only for one table per-run. If you want to process full keyspace you need a script that runs DSBulk for each table.

提交回复
热议问题