You need to enable JavaScript to run this app.
文档中心
对象存储

对象存储

复制全文
下载 pdf
TOS Import(即将废弃)
快速使用 TOS Import
复制全文
下载 pdf
快速使用 TOS Import

本文以迁移本地文件为例,介绍如何在 Linux 系统单机模式部署 TOS Import 工具的迁移环境,然后将本地文件迁移至 TOS。

前提条件

  • 已获取 Region 及 Endpoint 信息。关于 Region 及 Endpoint 信息的详细介绍,请参见地域及访问域名
  • 已获取访问密钥 Access Key ID 和 Secret Access Key 信息。具体操作,请参见查看 AKSK 信息

注意事项

  • 使用 TOS Import 迁移文件到 TOS 后,文件的存储类型默认为标准存储。
  • TOS Import 需要存储中间结果到工作目录,每个对象 2KB 左右(对象名称越长,占用空间越大),您需要根据对象数量预估磁盘占用量,保证足够磁盘空间,否则会导致迁移数据中断,迁移任务会失败。迁移完成后,删除迁移任务可以删除这些中间结果文件。

操作步骤

本文将 tos-import.linux_x86.tar.gz 解压到 /root 目录下为例,操作说明如下:

  • ./tos-import 命令都将在 /root/tos-import 目录下执行。
  • task-local.template.yaml 文件在 /root/tos-import/task 目录下。
  1. 部署迁移环境。

    1. 执行以下命令,下载工具包。

      wget  https://tos-tools.tos-cn-beijing.volces.com/linux/tos-import.linux_x86.tar.gz
      
    2. 执行以下命令,将工具包解压至任意有读写访问权限的路径上。

      tar -zxvf tos-import.linux_x86.tar.gz -C /root
      
    3. 执行以下命令,部署迁移环境。

      说明

      已默认 tos-import 所在的绝对路径为 /root/tos-import,因此无需配置work_dir参数,即可部署迁移环境。如果 tos-import 所在的绝对路径不是 /root/tos-import,您需要修改 server.yamlwork_dir参数,详细介绍,请参见部署迁移环境

      ./tos-import deploy
      

      预期返回以下内容:

      work\_dir unset, use path</root/tos-import> as default.
      Welcome To TOS Import! Deploy success!
      Deploy mode: Local.
      
  2. 创建迁移环境。

    1. 执行以下命令,在 task-local.template.yaml 文件设置迁移任务参数,然后保存并退出。

      说明

      关于 task-local.template.yaml 参数的详细介绍,请参见配置文件说明

      vi task-local.template.yaml
      

      task-local.template.yaml文件内容如下:

      task_name: "tesk1"                            #迁移任务名称。
      src_type: "local"                             #迁移源端类型。                      
      src_prefix: "/root/uploads"                   #需要迁移的源端文件路径前缀 。
      src_suffix: ""
      dest_type: "tos"                              #目的端类型。
      dest_ak: "your access key"                    #访问目的端对象存储的 AccessKey ID。
      dest_sk: "your secret key"                    #访问目的端对象存储的 AccessKey Secret。
      dest_security_token: ""
      dest_region: "cn-beijing"                     #目的端 Region。
      dest_endpoint: "tos-cn-beijing.volces.com"    #目的端域名。
      dest_http_proxy: ""
      dest_bucket: "aaa"                            #目的端存储桶的名称。
      dest_prefix: ""
      rename_regex: ""
      rename_to: ""
      is_incremental: false
      incremental_interval: 3600
      incremental_times: 3
      import_since: ""
      over_write_policy: "force"
      task_bandwidth: 102400
      task_file_mps: 1000
      verify_data_crc64: true
      failed_num_to_abort: 0
      secret_algorithm: ""
      secret_key: ""
      
    2. 执行以下命令,创建迁移任务。

      ./tos-import create  --conf task/task-local.template.yaml
      

      预期返回以下内容:

      Create migrate task 'test1' success, source type: local
      
  3. 查看迁移进度。
    执行以下命令,查看迁移任务进度。

    ./tos-import list
    

    当返回结果中 TaskStatus 参数显示 success,说明迁移数据成功。

最近更新时间:2024.08.02 16:13:12
这个页面对您有帮助吗?
有用
有用
无用
无用