前一篇提到了,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. 最强最全面的大数据SQL经典面试题(由31位大佬共同协作完成)

    本套SQL题的答案是由许多小伙伴共同贡献的,1+1的力量是远远大于2的,有不少题目都采用了非常巧妙的解法,也有不少题目有多种解法.本套大数据SQL题不仅题目丰富多样,答案更是精彩绝伦! 注:以下参考答 ...

  2. SpringCloud(四) config

    Spring Cloud Config 在分布式系统中,尤其是当我们的分布式项目越来越多,每个项目都有自己的配置文件,对配置文件的统一管理就成了一种需要,而 Spring Cloud Config 就 ...

  3. Dapr项目应用探索

    背景介绍 前面文章对Dapr的基本信息进行了学习,接下来尝试将Dapr应用相关应用中. 接下来一步步实现应用dapr功能. 一.预期效果 如上图应用Dapr点包含: a) 报表服务绑定统一数据源服务: ...

  4. 【LeetCode】1079. Letter Tile Possibilities 解题报告 (C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 回溯 日期 题目地址:https://leetcode ...

  5. 【LeetCode】18. 4Sum 四数之和

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 个人公众号:负雪明烛 本文关键词:four sum, 4sum, 四数之和,题解,leet ...

  6. codeforce-601A. The Two Routes(最短路)

    题意: 给你N个点表示N个站,有汽车和火车,汽车只能走公路,火车只能走铁路. 然后给你M条双向路,代表这两个点之间有铁路连接. 然后告诉你如果两个点之间没有铁路,那么就是公路连接. 问你汽车和火车都到 ...

  7. 1007 - Mathematically Hard

    1007 - Mathematically Hard    PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 6 ...

  8. 1289 - LCM from 1 to n

    http://blog.csdn.net/acdreamers/article/details/18507767 这个是位图的链接,这篇写的挺好. 模板: 1 #include<math.h&g ...

  9. ORA-14450: 试图访问已经在使用的事务处理临时表

    需要对临时表动态添加列,经常碰到表在事务中被使用的情况,如果可以的话,可以现在只用临时表的时候先truncate,这样可以终止事务对当前临时表的占用. execute immediate('trunc ...

  10. 基于Spring MVC + Spring + MyBatis的【学生信息管理系统】

    资源下载:https://download.csdn.net/download/weixin_44893902/45603211 练习点设计: 模糊查询.删除.新增 一.语言和环境 实现语言:JAVA ...