influxdb数据库备份和恢复数据

导出数据库数据

influxd backup -portable -database monidb /backup  # 备份数据
tar -cvf backup.tar /backup  # 打包数据

解压缩备份数据

/ # tar -xvf backup.tar
backup/
backup/20180904T092657Z.meta
backup/20180904T092657Z.s2.tar.gz
backup/20180904T092657Z.s3.tar.gz
backup/20180904T092657Z.s4.tar.gz
backup/20180904T092657Z.s5.tar.gz
backup/20180904T092657Z.s6.tar.gz
backup/20180904T092657Z.s7.tar.gz
backup/20180904T092657Z.s8.tar.gz
backup/20180904T092657Z.s9.tar.gz
backup/20180904T092657Z.s10.tar.gz
backup/20180904T092657Z.s11.tar.gz
backup/20180904T092657Z.s12.tar.gz
backup/20180904T092657Z.s13.tar.gz
backup/20180904T092657Z.s14.tar.gz
backup/20180904T092657Z.s16.tar.gz
backup/20180904T092657Z.s17.tar.gz
backup/20180904T092657Z.s18.tar.gz
backup/20180904T092657Z.s19.tar.gz
backup/20180904T092657Z.s20.tar.gz
backup/20180904T092657Z.s21.tar.gz
backup/20180904T092657Z.s22.tar.gz
backup/20180904T092657Z.s23.tar.gz
backup/20180904T092657Z.s24.tar.gz
backup/20180904T092657Z.s25.tar.gz
backup/20180904T092657Z.manifest

恢复备份数据到数据库

/ # influxd restore -portable ./backup
2018/09/04 10:45:06 Restoring shard 9 live from backup 20180904T092657Z.s9.tar.gz
2018/09/04 10:45:06 Restoring shard 10 live from backup 20180904T092657Z.s10.tar.gz
2018/09/04 10:45:06 Restoring shard 18 live from backup 20180904T092657Z.s18.tar.gz
2018/09/04 10:45:06 Restoring shard 25 live from backup 20180904T092657Z.s25.tar.gz
2018/09/04 10:45:06 Restoring shard 6 live from backup 20180904T092657Z.s6.tar.gz
2018/09/04 10:45:06 Restoring shard 7 live from backup 20180904T092657Z.s7.tar.gz
2018/09/04 10:45:06 Restoring shard 8 live from backup 20180904T092657Z.s8.tar.gz
2018/09/04 10:45:06 Restoring shard 11 live from backup 20180904T092657Z.s11.tar.gz
2018/09/04 10:45:06 Restoring shard 13 live from backup 20180904T092657Z.s13.tar.gz
2018/09/04 10:45:06 Restoring shard 19 live from backup 20180904T092657Z.s19.tar.gz
2018/09/04 10:45:06 Restoring shard 22 live from backup 20180904T092657Z.s22.tar.gz
2018/09/04 10:45:06 Restoring shard 23 live from backup 20180904T092657Z.s23.tar.gz
2018/09/04 10:45:06 Restoring shard 5 live from backup 20180904T092657Z.s5.tar.gz
2018/09/04 10:45:06 Restoring shard 14 live from backup 20180904T092657Z.s14.tar.gz
2018/09/04 10:45:06 Restoring shard 16 live from backup 20180904T092657Z.s16.tar.gz
2018/09/04 10:45:06 Restoring shard 17 live from backup 20180904T092657Z.s17.tar.gz
2018/09/04 10:45:06 Restoring shard 21 live from backup 20180904T092657Z.s21.tar.gz
2018/09/04 10:45:06 Restoring shard 24 live from backup 20180904T092657Z.s24.tar.gz
2018/09/04 10:45:06 Restoring shard 12 live from backup 20180904T092657Z.s12.tar.gz
2018/09/04 10:45:06 Restoring shard 3 live from backup 20180904T092657Z.s3.tar.gz
2018/09/04 10:45:06 Restoring shard 4 live from backup 20180904T092657Z.s4.tar.gz
2018/09/04 10:45:06 Restoring shard 20 live from backup 20180904T092657Z.s20.tar.gz
2018/09/04 10:45:06 Restoring shard 2 live from backup 20180904T092657Z.s2.tar.gz

你可能感兴趣的:(InfluxDB)