Last active
July 10, 2023 17:07
-
-
Save polarnik/8d3d769aeb416ff812a44e9f1cede5db to your computer and use it in GitHub Desktop.
Migrate InfluxDB metrics from InfluxDB2 to VictoriaMetrics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
influxd inspect export-lp --bucket-id 5d69c811b871b876 --engine-path /var/lib/influxdb2/engine --output-path /var/lib/influxdb2/ClientMetricsExport.txt | |
cd /var/lib/influxdb2/ | |
split -d -l 1000 -a 10 ./ClientMetricsExport.txt 1k_lines | |
files=(1k_lines*) | |
for ((i=${#files[@]}-1; i>=0; i--)); do | |
echo "${files[$i]}" | |
curl --verbose -i -XPOST --data-binary "@${files[$i]}" 'http://victoriaMetrics:8428/write?db=ClientMetrics&rp=auto&precision=n' | |
done | |
rm 1k_lines* | |
rm ClientMetricsExport.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Performance metrics:
2 requests per second
2000 points per second
50 Kbytes per second
I need to migrate 30 000 000 points. This action lasts about 4 hours