-
Notifications
You must be signed in to change notification settings - Fork 3
Frequently Asked Questions
Massimo Gaggero edited this page Feb 26, 2020
·
1 revision
- No recent data after reboot
- InfluxDB seems not saving the data
- Backup InfluxDB database
- Restore InfluxDB database
See InfluxDB seems not saving the data.
Some file in the database may be corrupted.
Enter to the edge Gateway console:
# cd /opt/tdm-edge/
# docker-compose exec influxdb "cp -rp /var/lib/influxdb /root/influxbackup/"
# docker-compose exec influxdb influx_inspect export -datadir /var/lib/influxdb/data -waldir /var/lib/influxdb/wal -out /root/influxdb.dmp -compress
# docker-compose exec influxdb "rm -rf /var/lib/influxdb/*"
# docker-compose restart influxdb
# docker-compose exec influxdb influx -import -compressed -path /root/influxdb.dmp
Enter to the Edge Gateway console:
# cd /opt/tdm-edge/
# mkdir /home/alarm/influxbackup/
# docker cp tdm_influxdb:/var/lib/influxdb /home/alarm/influxbackup/
The folder '/home/alarm/influxbackup/' contains the raw db files.
To export the database:
# docker-compose exec influxdb influx_inspect export -datadir /var/lib/influxdb/data -waldir /var/lib/influxdb/wal -out /root/influxdb.dmp -compress
# docker cp tdm_influxdb:/root/influxdb.dmp /home/alarm/
Suppose the db dump file to import is '/home/alarm/influxdb.dmp', enter to the Edge Gateway console, then:
# cd /opt/tdm-edge/
# docker cp /home/alarm/influxdb.dmp tdm_influxdb:/root/
# docker-compose exec influxdb influx -import -compressed -path /root/influxdb.dmp