Yarmo - monitoringBlog of an Open Source developerZola2022-05-20T18:36:41+00:00https://yarmo.eu/tags/monitoring/atom.xmlInfluxDB 2 migration2022-05-20T18:36:41+00:002022-05-20T18:36:41+00:00
Unknown
https://yarmo.eu/blog/influxdb-2-migration/<h2 id="What_is_InfluxDB?">What is InfluxDB?</h2>
<p><a href="https://www.influxdata.com/">InfluxDB</a> is the <a href="https://github.com/influxdata/influxdb/blob/master/LICENSE">MIT licensed</a> <a href="https://en.wikipedia.org/wiki/Time_series_database">time series database</a> of my monitoring stack of choice, the so-called <a href="https://www.influxdata.com/blog/introduction-to-influxdatas-influxdb-and-tick-stack/">TICK stack</a>, consisting of <a href="https://www.influxdata.com/time-series-platform/telegraf/">Telegraf</a> (data collection agent), <a href="https://www.influxdata.com/">InfluxDB</a> (time series database), <a href="https://www.influxdata.com/time-series-platform/chronograf/">Chronograf</a> (charts and dashboard interface) and <a href="https://www.influxdata.com/time-series-platform/kapacitor/">Kapacitor</a> (data processing engine).</p>
<h2 id="My_history_with_InfluxDB">My history with InfluxDB</h2>
<p>I started my homelab somewhere in 2017-2018. When about a year in I faced some random crashes and reboots which I did not manage to understand or fix, I first turned to <a href="https://github.com/netdata/netdata">netdata</a> before settling with the TICK stack.</p>
<p>While I did eventually solve the random crashes, an obvious issue surfaced: if I want to monitor a crashing server, I probably shouldn't host the monitoring stack on that same server.</p>
<p>And so, my setup eventually converged to the one I use today: a homelab and a few VPSs, all monitored by a TICK stack installed on a dedicated VPS.</p>
<p><a href="https://docs.influxdata.com/influxdb/v2.0/reference/release-notes/influxdb/">InfluxDB 2.0</a> was released in November of 2020 and I remember this moment clearly: I updated my InfluxDB docker container, I noticed everything immediately broke, I read up on what a gargantuan update this 2.0 release was, I said "nope" and immediately reverted to 1.8.x.</p>
<p>Yesterday, I decided it was finally time to sit down and calmly move to InfluxDB 2(.2.0).</p>
<h2 id="InfluxDB_2,_or_the_Death_of_the_TICK_stack">InfluxDB 2, or the Death of the TICK stack</h2>
<p>Please refer <a href="https://docs.influxdata.com/influxdb/v2.0/reference/release-notes/influxdb/">release notes for InfluxDB 2</a> to see for yourself what has changed.</p>
<p>One of the most notable changes is that InfluxDB 2 now has a interface with graphs and dashboards (replacing Chronograf's functionality) and can send alerts based on data (which previously required Kapacitor). While I am sure Chronograf and Kapacitor can still be used together with InfluxDB 2, they no longer need to and indeed, I have now removed these services from my monitoring stack.</p>
<h2 id="InfluxDB_2,_the_migration">InfluxDB 2, the migration</h2>
<p>The <a href="https://hub.docker.com/_/influxdb">InfluxDB 2 dockerhub page</a> has clear instructions on how to migrate from 1.x to 2.x when using containers and so I did. And while the container logs showed the migration process was successful, I had this weird issue where when I would try to then log in on the web interface, I was greeted with a "fresh install" screen, suggesting the InfluxDB instance was in fact not aware of the migration.</p>
<p>And indeed, after following the instructions of the "fresh install" screen, everything was working fine but no trace of any migrated data :(</p>
<p>If my historical InfluxDB data was in any way valuable to me, I would have put more effort into migrating all of it to InfluxDB 2.</p>
<p>But it wasn't.</p>
<h2 id="InfluxDB_2,_the_non-migration">InfluxDB 2, the non-migration</h2>
<p>And thus, in a bit of an anticlimax to this whole situation, I <code>rm -rf</code>ed the whole data directory and started anew with a fresh InfluxDB 2 instance. No more Chronograf, no more Kapacitor. All servers have updated Telegraf configurations and I am currently rebuilding the dashboards in InfluxDB's web interface.</p>
<p>And I also still need to rebuild my Grafana dashboards to make use of Flux instead of InfluxQL. I still have things to do before I can fully enjoy my monitoring solution again.</p>