Skip to content

Repository files navigation

Data Migrate

A distributed data migration system built in Go that uses rclone for efficient data transfer across multiple clients.

Overview

This system provides a distributed architecture for migrating large volumes of data using rclone. It consists of a single server that coordinates migration tasks and multiple clients that execute the actual data transfer operations.

Features

  • Distributed Task Processing: Multiple clients can work simultaneously on different migration tasks
  • Progress Monitoring: Real-time progress tracking for all migration tasks
  • Result Persistence: Task results and rclone logs are saved to S3 for later analysis
  • Resource Management: Efficient handling of connections and goroutines
  • File System Detection: Built-in utilities for detecting file system types

Architecture

┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Data Sources │ │ Server │ │ Client #1 │
│ (tasks.txt) │────▶ (Coordinator) │────▶ (Worker) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
| │
| ▼
| ┌─────────────────┐
| │ rclone copy │
| │ Execution │
| └─────────────────┘
| │
┌─────────────────┐ ┌─────────┴─────────┐
│ Task Results │◀─── │ Source Data │
│ │ │ Destination │
└─────────────────┘ └───────────────────┘

Installation

Prerequisites

  • rclone installed and configured on all client machines
  • Network connectivity between server and clients

Building from Source

# Clone the repository
git clone https://github.com/microyahoo/data-migrate.git
cd data-migrate
make build-local
# build image
make build

Quick Start

Prepare Configuration File

report_config:
format: csv # csv, md or htmls3_config:
access_key: <access key>secret_key: <secret key>region: us-east-1endpoint: <s3 endpoint>bucket: testskipSSLverify: trueglobal_config:
ultra_large_scale: false # indicate ultra-large-scale taskserver_side_listing: false # Whether to list files on server sidefeishu_url: "feishu_url"source_fs_types:
- yrfs_ec
- gpfstarget_fs_types:
- yrfs_ec
- gpfstasks_file: deploy/data_sources.txtfile_list_dir: /mnt/yrfs/public-data/user/zhengliang/file_list_dir_fs_type: yrfs_ecmax_files_per_output: 500000concurrency: 3rclone_flags:
checkers: 64transfers: 64log_level: INFOlocal_no_set_modtime: truesize_only: truedryrun: true

Prepare data sources

# Format: source_path destination_path file_list_path
/mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_1/ /mnt/yrfs/public-data/training/samples/camera_1/ /mnt/core-data/data/3d_object_gt/data_sync/results/sync_3d/mnt#csi-data-gfs#lidar#deeproute_all#samples#camera_1#.txt
/mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_2/ /mnt/yrfs/public-data/training/samples/camera_2/ /mnt/core-data/data/3d_object_gt/data_sync/results/sync_3d/mnt#csi-data-gfs#lidar#deeproute_all#samples#camera_2#.txt
/mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_3/ /mnt/yrfs/public-data/training/samples/camera_3/

Start the Server

# Start server with default settings
./bin/data-migrate-server --config.file <config-file># Or specify custom port
./bin/data-migrate-server --config.file <config-file> --server.port 2000

Start Clients

On client machines (or multiple terminals on the same machine):

./bin/data-migrate-worker --server.address <server-ip:port>

Results

idsubtask idsource dirtarget dirclient iddurationsuccesssplit patternsplit filesfile fromlog filemessage
10/mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_1//mnt/yrfs/public-data/training/samples/camera_1/127.0.0.1:44476827.565sfalse0path does not exist: stat /mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_1: no such file or directory
20/mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_2//mnt/yrfs/public-data/training/samples/camera_2/127.0.0.1:44476213.905sfalse0path does not exist: stat /mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_2: no such file or directory
30/mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_3//mnt/yrfs/public-data/training/samples/camera_3/127.0.0.1:44476262.946sfalse0path does not exist: stat /mnt/csi-data-gfs/lidar/deeproute_all/samples/camera_3: no such file or directory
40/root/go/src/deeproute/ops-kubeconfig//tmp/zhengliang127.0.0.1:44476245.162616mstrue/mnt/yrfs/public-data/user/zhengliang/1765869105/k1-124103/test1.txt_*.index3rclone/log-files/1765869105/rclone_copy_1765869105_4_worker2_test1.txt_0003.index.logMigrated task 4 successfully
50/var/tmp/zhengliang/var127.0.0.1:44476211.516957mstrue/mnt/yrfs/public-data/user/zhengliang/1765869105/k1-124103/test2.txt_*.index1rclone/log-files/1765869105/rclone_copy_1765869105_5_worker0_test2.txt_0001.index.logMigrated task 5 successfully
60/etc/udev/tmp/zhengliang/etc/udev127.0.0.1:44476153.251914mstrue/mnt/yrfs/public-data/user/zhengliang/1765869105/k1-124103/udev_*.index1rclone/log-files/1765869105/rclone_copy_1765869105_6_worker0_udev_0001.index.logMigrated task 6 successfully
70/root/go/src/github.com/rclone/tmp/zhengliang/rclone127.0.0.1:44476269.019774mstrue/mnt/yrfs/public-data/user/zhengliang/1765869105/k1-124103/rclone_*.index3rclone/log-files/1765869105/rclone_copy_1765869105_7_worker2_rclone_0001.index.logMigrated task 7 successfully
idsubtask idsource dirtarget dirclient iddurationsuccesssplit patternsplit filesfile fromlog filemessage
11/root/go/src/deeproute/ops-kubeconfig//tmp/zhengliang127.0.0.1:44426580.579634mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/test1.txt_0001.indexrclone/log-files/1765868733/rclone_copy_1765868733_1_worker0_test1.txt_0001.index.logMigrated task 1 with subtask 1 successfully
12/root/go/src/deeproute/ops-kubeconfig//tmp/zhengliang127.0.0.1:44426684.392755mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/test1.txt_0002.indexrclone/log-files/1765868733/rclone_copy_1765868733_1_worker0_test1.txt_0002.index.logMigrated task 1 with subtask 2 successfully
13/root/go/src/deeproute/ops-kubeconfig//tmp/zhengliang127.0.0.1:44426408.588032mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/test1.txt_0003.indexrclone/log-files/1765868733/rclone_copy_1765868733_1_worker0_test1.txt_0003.index.logMigrated task 1 with subtask 3 successfully
10/root/go/src/deeproute/ops-kubeconfig//tmp/zhengliang1.673749696strue0
21/var/tmp/zhengliang/var127.0.0.1:44426211.162227mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/test2.txt_0001.indexrclone/log-files/1765868733/rclone_copy_1765868733_2_worker0_test2.txt_0001.index.logMigrated task 2 with subtask 1 successfully
20/var/tmp/zhengliang/var211.161139mstrue0
31/etc/udev/tmp/zhengliang/etc/udev127.0.0.1:44426202.684248mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/udev_0001.indexrclone/log-files/1765868733/rclone_copy_1765868733_3_worker0_udev_0001.index.logMigrated task 3 with subtask 1 successfully
30/etc/udev/tmp/zhengliang/etc/udev202.682738mstrue0
41/root/go/src/github.com/rclone/tmp/zhengliang/rclone127.0.0.1:44426455.557088mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/rclone_0001.indexrclone/log-files/1765868733/rclone_copy_1765868733_4_worker0_rclone_0001.index.logMigrated task 4 with subtask 1 successfully
42/root/go/src/github.com/rclone/tmp/zhengliang/rclone127.0.0.1:44426854.990683mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/rclone_0002.indexrclone/log-files/1765868733/rclone_copy_1765868733_4_worker0_rclone_0002.index.logMigrated task 4 with subtask 2 successfully
43/root/go/src/github.com/rclone/tmp/zhengliang/rclone127.0.0.1:44426811.397944mstrue0/mnt/yrfs/public-data/user/zhengliang/1765868733/k1-122346/rclone_0003.indexrclone/log-files/1765868733/rclone_copy_1765868733_4_worker0_rclone_0003.index.logMigrated task 4 with subtask 3 successfully
40/root/go/src/github.com/rclone/tmp/zhengliang/rclone2.122083391strue0

About

Data Migrate

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages