Upgrade influxdb from v0.9 to v0.12

Upgrade influxdb from v0.9 to v0.10

Table

Comparison 0.9 0.10
engine b1\ bz1 tsm1

upgrade from v0.9 to v0.10

$ influx_tsm -h
:<<DOC
Usage: influx_tsm [options] <data-path>
Convert a database from b1 or bz1 format to tsm1 format.
This tool will backup the directories before conversion (if not disabled).
The backed-up files must be removed manually, generally after starting up the
node again to make sure all of data has been converted correctly.
To restore a backup:
Shut down the node, remove the converted directory, and
copy the backed-up directory to the original location.
Options:
-backup="": The location to backup up the current databases. Must not be within the data directory.
-dbs="": Comma-delimited list of databases to convert. Default is to convert all databases.
-debug="": If set, http debugging endpoints will be enabled on the given address
-interval=5s: How often status updates are printed.
-nobackup=false: Disable database backups. Not recommended.
-parallel=false: Perform parallel conversion. (up to GOMAXPROCS shards at once)
-profile="": CPU Profile location
-sz=2147483648: Maximum size of individual TSM files.
-y=false: Don't ask, just convert
DOC
$ ls /var/lib/influxdb
data hh meta wal
$ mkdir /tmp/influxdb_backup
$ influx_tsm -backup /tmp/influxdb_backup /var/lib/influxdb/data
# If you wish to minimize the time conversion takes, enable parallel mode with -parallel:
$ influx_tsm -parallel=true -backup /tmp/influxdb_backup /var/lib/influxdb/data
:<<OUTPUT
2016/04/19 00:18:44.362167 Still Working: Completed Shards: 27/28 Points read/written: 4192583424/4192583424
2016/04/19 00:18:49.362387 Still Working: Completed Shards: 27/28 Points read/written: 4192625739/4192625739
2016/04/19 00:18:54.362674 Still Working: Completed Shards: 27/28 Points read/written: 4192700371/4192700371
2016/04/19 00:18:59.362906 Still Working: Completed Shards: 27/28 Points read/written: 4192806162/4192806162
2016/04/19 00:19:04.363121 Still Working: Completed Shards: 27/28 Points read/written: 4192911040/4192911040
2016/04/19 00:19:09.363313 Still Working: Completed Shards: 27/28 Points read/written: 4192911040/4192911040
2016/04/19 00:19:13.912142 Conversion of /data/data/icinga/default/136 successful (8h6m31.481348028s)
Summary statistics
========================================
Databases converted: 2
Shards converted: 28
TSM files created: 28
Points read: 4192911040
Points written: 4192911040
NaN filtered: 0
Inf filtered: 0
Points without fields filtered: 0
Disk usage pre-conversion (bytes): 118480699392
Disk usage post-conversion (bytes): 17643390726
Reduction factor: 85%
Bytes per TSM point: 4.21
Total conversion time: 13h56m43.515786407s
OUTPUT

official upgrading guides

v0.10/administration/upgrading/
v0.11/administration/upgrading/
v0.12/administration/upgrading/
SeanBeckett4 influxdb-upgrade-to-010-considerations

Example Migration #2

Conditions:

  • Downtime is unacceptable
  • Converting from 0.9
  • Not clustered
  1. Install 0.10.1 on top of 0.9 and restart
  2. Copy “cold” B1/BZ1 shards to /tmp
  3. Run ./influx_tsm to convert cold shards influx_tsm -backup /tmp/influxdb_backup /tmp/data
  4. Remove cold B1/BZ1 shards and replace with converted TSM shards
  5. Wait until current “hot” shards become “cold”, repeat steps 2-4 on newly cold shards