LoginSignup
0
1

More than 1 year has passed since last update.

InfluxDB v1.8: データベースのバックアップとリストア

Posted at

参考ページ
Back up a specific database
Restore a specific database

バックアップ

influxd backup -portable -db example /tmp/backup

実行結果

$ influxd backup -portable -db example /tmp/backup
2022/12/08 09:56:35 backing up metastore to /tmp/backup/meta.00
2022/12/08 09:56:35 backing up db=example
2022/12/08 09:56:35 backing up db=example rp=autogen shard=9 to /tmp/backup/example.autogen.00009.00 since 0001-01-01T00:00:00Z
2022/12/08 09:56:35 backup complete:
2022/12/08 09:56:35 	/tmp/backup/20221208T005635Z.meta
2022/12/08 09:56:35 	/tmp/backup/20221208T005635Z.s9.tar.gz
2022/12/08 09:56:35 	/tmp/backup/20221208T005635Z.manifest

データベースを削除

データベースがあることを確認

influx -execute 'show databases'

削除

influx -execute 'drop database example'

削除されたことを確認

influx -execute 'show databases'

リストア

influxd restore -portable -db example /tmp/backup

実行結果

$ influxd restore -portable -db example /tmp/backup
2022/12/08 10:00:28 Restoring shard 9 live from backup 20221208T005635Z.s9.tar.gz

データの確認

$ influx -precision rfc3339
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
> use example
Using database example
> show measurements
name: measurements
name
----
Data
> 
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1