前一篇提到了,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. oracle同义词创建(synonym)

    oracle同义词创建(synonym)   在现在的项目中会有很多接口,数据来源也可能是不同数据库或者是不同的用户下的表,给访问该表带来了一定的麻烦.这个时候就可以使用同义词来简化. 同义词的语法是 ...

  2. Spring Boot中yml配置文件Map集合注入及使用方式

    yml配置文件 maps: "{key1: 'value1', key2: 'value2'}" java中 @Value("#{${maps}}") priv ...

  3. layui(layer)的loading方法显示位置不居中

    要在layer.load之前使用layer.ready方法 layui.use('layer', function () { layer.ready(function(){ index = layer ...

  4. 【LeetCode】141. Linked List Cycle 解题报告(Java & Python & C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 双指针 保存已经走过的路径 日期 [LeetCode ...

  5. 【LeetCode】17. Letter Combinations of a Phone Number 电话号码的字母组合

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 个人公众号:负雪明烛 本文关键词:电话号码, 字母组合,回溯法,题解,leetcode, ...

  6. 【LeetCode】337. House Robber III 解题报告(Python)

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

  7. Soldier and Traveling

    B. Soldier and Traveling Time Limit: 1000ms Memory Limit: 262144KB 64-bit integer IO format: %I64d   ...

  8. Lightoj1011 - Marriage Ceremonies

    1011 - Marriage Ceremonies   PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 ...

  9. VMware15 虚拟机分别设置连接笔记本的WLAN和以太网双网络

    VMware15 虚拟机分别设置连接笔记本的WLAN和以太网双网络 虚拟机:window 10 主机: window 10 VVmware有3种网络连接模式:桥接.NAT.主机模式,默认分别对应VMN ...

  10. Codeforces 1076G Array Game 题解

    目录 题目大意 做法 代码 不想写昨天晚上cf的比赛题目所以来写题解摸摸鱼 题目大意 有一个在长度为\(k\)的正整数序列\(b\)上进行的游戏,一开始一个棋子放在位置\(1\),假如当前棋子的位置为 ...