VictoriaMetrics:使用vmctl来实现vm-storage向victoria-metrics-prod(单机版)迁移数据
前一篇提到了,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(单机版)迁移数据的更多相关文章
- Azure Storage 利用 azCopy 复制迁移数据
		一,引言 前两天遇到了Azure Blob Storage 需要迁移到另外的一个 Azure Blob Storage 中.手动下载.上传已经无法满足了,得另寻一种方式了 AzCopy.Azure 为 ... 
- VM Storage Policies深度解析
- 【Azure Developer】使用Java SDK代码创建Azure VM (包含设置NSG,及添加数据磁盘SSD)
		在参考Azure官方文档进行VM创建时,发现其中没有包含如何设置NSG的内容,以及如何在创建时就添加数据磁盘的代码(设置磁盘为SSD类型).本文的内容以"使用 Java 创建和管理 Azur ... 
- [New Portal]Windows Azure Virtual Machine (23) 使用Storage Space,提高Virtual Machine磁盘的IOPS
		<Windows Azure Platform 系列文章目录> 注意:如果使用Azure Virtual Machine,虚拟机所在的存储账号建议使用Local Redundant.不建议 ... 
- Windows Azure Virtual Machine (26) 使用高级存储(SSD)和DS系列VM
		<Windows Azure Platform 系列文章目录> Update: 2016-11-3,如果大家在使用Linux VM,使用FIO进行IOPS测试的时候,请使用以下命令: su ... 
- ES(3): ES Cluster Extended Azure Storage
		Azure VM的磁盘空间远远不能满足ES集群存储需求(还需除掉VM的临时盘),同时也未找着ES配置 block blob storage 存储的组件,因此下文介绍通过挂载附加盘的方式增加ES集群存储 ... 
- Exam E05-001 Information Storage and Management Version 3 Exam
		Emc 考试 e05-001信息存储和管理版本3考试 [总问题:171] 哪种 emc 产品提供软件定义的存储基础架构的自动监视和报告? A. viprSrmB. 斯纳普内C. 阿瓦马尔D. 快速副总 ... 
- 上海-北京间通过Azure Storage的RA-GRS类型的存储账户进行快速复制
		Azure的Blob存储分成多种类型,目前主要有: 其中RA-GRS可以在上海-北京两个数据中心间同步数据.并且,在第二个数据中心可以只读的方式读取这个存储账户中的Blob内容. 虽然GRS采用的是准 ... 
- google cloud storage products
		https://cloud.google.com/products/storage/ BigTable Cloud Bigtable 是 Google 面向大数据领域的 NoSQL 数据库服务.它也是 ... 
随机推荐
- LuoguP5006 [yLOI2018] 大美江湖 题解
			Content 题意实在是太过复杂了,因此请回到题面查看. Data Range 本部分和 Solution 部分变量的含义同题面. \(1\leqslant n,m\leqslant 100,0\l ... 
- java 网络编程基础 UDP协议DatagramSocket,MulticastSocket 实现局域网聊天软件(Server + Client模式)
			开发思路: 服务端两个Socket: UDP的DatagramSocket接收客户端消息. 广播multicastSocket 发送广播消息 客户端一个Socket: multicastSocke ... 
- springboot使用线程池(ThreadPoolTaskExecutor)
			代码仓库:gitee 线程池创建 ` @Configuration @EnableAsync public class TaskPoolConfig { @Bean("syncExecuto ... 
- 移动端滚动方案:better-scroll
			BetterScroll 是什么 BetterScroll 是一款重点解决移动端(已支持 PC)各种滚动场景需求的插件.它的核心是借鉴的 iscroll (opens new window) 的实现, ... 
- MyBatis学习(一)基本配置与使用
			MyBatis学习(一)基本配置与使用 1.前期准备 文件具体架构图 1.配置conf.xml <?xml version="1.0" encoding="UTF- ... 
- JAVA获取请求链接中所有参数(GET请求)
			Enumeration<String> paraNames=request.getParameterNames(); for(Enumeration<String> e=par ... 
- Protobuf 动态加载 .proto 文件并操作 Message
			Google Protocol Buffer 的常规用法需要使用 protoc 将 .proto 编译成 .pb.h 和 .pb.cc,这样做效率非常高,但是耦合性也很高.在某些追求通用性而不追求性能 ... 
- 【Tools】VS搭建Qt开发环境
			00. 目录 @ 目录 00. 目录 01. 概述 02. Visual Studio 2019安装 03. Qt6安装 04. qt-vsaddin插件下载 05. qt-vsaddin插件安装 0 ... 
- 【LeetCode】520. Detect Capital 解题报告(Java & Python)
			作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 循环判断三个条件 大写字母个数和位置判断 根据首字符 ... 
- 【LeetCode】332. Reconstruct Itinerary 解题报告(Python)
			作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 后序遍历 相似题目 参考资料 日期 题目地址:htt ... 
