前一篇提到了,vm-storage的备份数据,无法被victoria-metrics-prod(单机版)读取。

继续翻文档发现vmctl可以实现这个效果:

1.启动vm-restore恢复数据

vmrestore-prod \
-configFilePath="/etc/cos/config.ini" \
-credsFilePath="/etc/cos/creds.ini" \
-customS3Endpoint="https://cos.ap-guangzhou.myqcloud.com" \
-src="s3://bucket/vm-storage/2021-12-27/" \
-storageDataPath="/var/victoria-metrics/data/2021-12-27/" \
-httpListenAddr="0.0.0.0:8420" \
-memory.allowedBytes=2GB \
-concurrency=10 \
-maxBytesPerSecond=100MB

2.启动vm-storage

vmstorage-prod \
-memory.allowedBytes 30GB \
-storageDataPath /var/victoria-metrics/data/2021-12-27/ \
-retentionPeriod=15d \
-httpListenAddr 0.0.0.0:8482 \
-vminsertAddr 0.0.0.0:8400 \
-vmselectAddr 0.0.0.0:8401 \
-search.maxTagKeys 100000 \
-search.maxTagValues 1000000 \
-search.maxUniqueTimeseries=10000000

3.启动一个vm-select来查询这个节点

vmselect-prod \
-cacheDataPath /var/victoria-metrics/cache \
-memory.allowedBytes 10GB \
-replicationFactor 1 \
-storageNode 127.0.0.1:8401 \
-httpListenAddr 0.0.0.0:8481 \
-search.maxConcurrentRequests 2000 \
-search.maxPointsPerTimeseries 5000000 \
-search.maxQueryDuration 600s

4.启动victoria-metrics-prod(单机版)

victoria-metrics-prod \
-dedup.minScrapeInterval=30s \
-httpListenAddr="0.0.0.0:8428" \
-insert.maxQueueDuration=2m \
-maxInsertRequestSize=500MB \
-memory.allowedBytes=7GB \
-retentionPeriod=1y \
-search.maxConcurrentRequests=500 \
-search.maxPointsPerTimeseries=100000 \
-search.maxUniqueTimeseries=1000000 \
-storageDataPath=/var/victoria-metrics/data/vm-single/data/

5.启动vmctl来传输数据

vmctl-prod vm-native \
--vm-native-filter-time-start=0 \
--vm-native-filter-time-end=$(date +"%s") \
--vm-native-src-addr="http://127.0.0.1:8481/select/0/prometheus/" \
--vm-native-dst-addr="http://127.0.0.1:8428/"

运行结果:

VictoriaMetrics Native import mode
Initing export pipe from "http://127.0.0.1:8481/select/0/prometheus" with filters:
filter: match[]={__name__!=""}
start: 0
end: 1640919407
Initing import process to "http://127.0.0.1:8428":
Total: 5.81 GiB Speed: 1.29 MiB p/s
2021/12/31 12:13:22 Total time: 1h16m35.022151869s

结论:

  • 用vmctl来传输数据,奇慢,每秒传输几百KB数据。生产环境中用于迁移数据,简直是找死!

    • 统计下来,每核传输数速率 663kb/s (主要是vm单机版耗CPU很高)
    • 传输的时候,所有核跑满。可以通过增加CPU资源加快导入速度。
  • 这个东西可能只适合特定的某些数据的导入导出

VictoriaMetrics:使用vmctl来实现vm-storage向victoria-metrics-prod(单机版)迁移数据的更多相关文章

  1. Azure Storage 利用 azCopy 复制迁移数据

    一,引言 前两天遇到了Azure Blob Storage 需要迁移到另外的一个 Azure Blob Storage 中.手动下载.上传已经无法满足了,得另寻一种方式了 AzCopy.Azure 为 ...

  2. VM Storage Policies深度解析

  3. 【Azure Developer】使用Java SDK代码创建Azure VM (包含设置NSG,及添加数据磁盘SSD)

    在参考Azure官方文档进行VM创建时,发现其中没有包含如何设置NSG的内容,以及如何在创建时就添加数据磁盘的代码(设置磁盘为SSD类型).本文的内容以"使用 Java 创建和管理 Azur ...

  4. [New Portal]Windows Azure Virtual Machine (23) 使用Storage Space,提高Virtual Machine磁盘的IOPS

    <Windows Azure Platform 系列文章目录> 注意:如果使用Azure Virtual Machine,虚拟机所在的存储账号建议使用Local Redundant.不建议 ...

  5. Windows Azure Virtual Machine (26) 使用高级存储(SSD)和DS系列VM

    <Windows Azure Platform 系列文章目录> Update: 2016-11-3,如果大家在使用Linux VM,使用FIO进行IOPS测试的时候,请使用以下命令: su ...

  6. ES(3): ES Cluster Extended Azure Storage

    Azure VM的磁盘空间远远不能满足ES集群存储需求(还需除掉VM的临时盘),同时也未找着ES配置 block blob storage 存储的组件,因此下文介绍通过挂载附加盘的方式增加ES集群存储 ...

  7. Exam E05-001 Information Storage and Management Version 3 Exam

    Emc 考试 e05-001信息存储和管理版本3考试 [总问题:171] 哪种 emc 产品提供软件定义的存储基础架构的自动监视和报告? A. viprSrmB. 斯纳普内C. 阿瓦马尔D. 快速副总 ...

  8. 上海-北京间通过Azure Storage的RA-GRS类型的存储账户进行快速复制

    Azure的Blob存储分成多种类型,目前主要有: 其中RA-GRS可以在上海-北京两个数据中心间同步数据.并且,在第二个数据中心可以只读的方式读取这个存储账户中的Blob内容. 虽然GRS采用的是准 ...

  9. google cloud storage products

    https://cloud.google.com/products/storage/ BigTable Cloud Bigtable 是 Google 面向大数据领域的 NoSQL 数据库服务.它也是 ...

随机推荐

  1. Spring核心原理分析之MVC九大组件(1)

    本文节选自<Spring 5核心原理> 1 什么是Spring MVC Spring MVC 是 Spring 提供的一个基于 MVC 设计模式的轻量级 Web 开发框架,本质上相当于 S ...

  2. mdf与ldf文件如何还原到SQL Server数据库

    1,首先新建两个数据库(Db1,Db2) 在Db1数据库中添加一个表: 然后点击数据库右键-属性-文件-找到文件路径 然后复制这个路径中的Db1的数据,把这两个文件放到其他文件之下 复制之前需要关闭S ...

  3. JAVA整合Redis使用redisTemplate清除库中的所有键值对数据

    JAVA整合Redis使用redisTemplate清除库中的所有键值对数据,清除所有缓存数据 Set<String> keys = redisTemplate.keys("*& ...

  4. Lucene 基础数据压缩处理

    Lucene 为了使的信息的存储占用的空间更小,访问速度更快,采取了一些特殊的技巧,然 而在看 Lucene 文件格式的时候,这些技巧却容易使我们感到困惑,所以有必要把这些特殊 的技巧规则提取出来介绍 ...

  5. 【LeetCode】206. Reverse Linked List 解题报告(Python&C++&java)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 迭代 递归 日期 [LeetCode] 题目地址:h ...

  6. 【LeetCode】27. Remove Element 解题报告(Python & Java)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 双指针 记录起始位置 日期 题目地址:https:/ ...

  7. 【LeetCode】173. Binary Search Tree Iterator 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 保存全部节点 只保留左节点 日期 题目地址:http ...

  8. 1340 - Story of Tomisu Ghost

    1340 - Story of Tomisu Ghost   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: ...

  9. The Balance(poj2142)

    The Balance Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 5452   Accepted: 2380 Descr ...

  10. Normalization Methods

    目录 概 主要内容 Batch Normalization Layer Normalization Instance Normalization Group Normalization Ioffe S ...