This server is managed by the IT Services Group (ISG) in the Physics Department. For support please contact ISG DPHYS Helpdesk.
The following services are hosted on this server. Please use the links below to access the respective services.
The diagram below shows an overview of the services.
The databases are backed up every night using the scripts provided here. This guide shows how to backup and restore InfluxDB (v.1.5+) using the legacy method. If you want to migrate your data to our InfluxDB instance follow the procedure to make a full backup and provide the location of your data to us. You can download the scripts here:
For more information please refer to out our readme page or the Backing up and restoring in InfluxDB OSS manual.
This guide assumes the backups are stored at the following location:
-
backupdir:
/var/backups/influxdb
If authentication is enabled, provide the admin user credentials in the file ~/.influx_admin
:
export INFLUX_USERNAME="admin" export INFLUX_PASSWORD="secret"
backup
To make a full InfluxDB backup use the script backup-influxdb
Save it to /usr/local/sbin
and add the execute bit chmod +x /usr/local/sbin/backup-influxdb
.
Running the script:
+phd-influx:~# backup-influxdb backup users... backup database meta... ... backup database _internal... ... backup database rda... ... backup database newdb...
will make a backup in a new directory with the current time stamp in the format
/var/backups/influxdb/YYYYmmdd-HHMMSS
using the following file structure:
+phd-influx:~# cd /var/backups/influxdb/20180406-150012 +phd-influx:/var/backups/influxdb/20180406-150012# tree . ├── data │ ├── _internal │ │ ├── _internal.monitor.00001.00 │ │ ├── _internal.monitor.00003.00 │ │ └── meta.00 │ ├── newdb │ │ ├── meta.00 │ │ └── newdb.autogen.00010.00 │ └── rda │ ├── meta.00 │ └── rda.autogen.00008.00 ├── meta │ └── meta.00 └── user ├── databases ├── databases.column ├── databases.csv ├── databases.json ├── grants_isg.column ├── grants_isg.csv ├── grants_isg.json ├── grants_obiwan.column ├── grants_obiwan.csv ├── grants_obiwan.json ├── grants_rda.column ├── grants_rda.csv ├── grants_rda.json ├── users ├── users.column ├── users.csv └── users.json
Single database (online) restore
To restore just a single database without interrupting InfluxDB or any other databases use the script restore-influxdb-database-online Run the following commands to do that:
/usr/bin/influx -execute "drop database db" /usr/local/sbin/restore-influxdb-database-online backupdir db [new_db]
For example to restore newdb
from backup 20180406-150012
:
+phd-influx:~# /usr/bin/influx -execute "drop database newdb" +phd-influx:~# /usr/local/sbin/restore-influxdb-database-online \ /var/backups/influxdb/20180406-150012 newdb This will restore (online) InfluxDB database: name: newdb from: /var/backups/influxdb/20180406-150012/data/newdb Are you sure? [y/N]y restore database newdb... ... grant privileges manually ('GRANT priv ON db TO user'): user:db,priv ------------ obiwan:newdb,ALL PRIVILEGES
Manually grant the privileges for user obiwan
(see script output):
+phd-influx:~# /usr/bin/influx -execute "GRANT ALL ON newdb TO obiwan"
To also rename the database on restore to newdb2
, use the following command:
+phd-influx:~# /usr/local/sbin/restore-influxdb-database-online \ /var/backups/influxdb/20180406-150012 newdb newdb2
Full InfluxDB restore (offline)
To restore a full backup of InfluxDB including all databases, use the script restore-influxdb-full Run the following commands to do that:
systemctl stop influxd rm -r /var/lib/influxdb/data rm -r /var/lib/influxdb/meta rm -r /var/lib/influxdb/wal /usr/local/sbin/restore-influxdb-full backupdir systemctl start influxd
while backupdir
is for example /var/backups/influxdb/20180406-150012
.
Example:
+phd-influx:~# systemctl stop influxd +phd-influx:~# rm -r /var/lib/influxdb/data +phd-influx:~# rm -r /var/lib/influxdb/meta +phd-influx:~# rm -r /var/lib/influxdb/wal +phd-influx:~# /usr/local/sbin/restore-influxdb-full /var/backups/influxdb/20180406-150012 This will restore InfluxDB: from: /var/backups/influxdb/20180406-150012 to: /var/lib/influxdb Are you absolutely sure? [y/N]n restore database meta... ... restore database _internal... ... restore database rda... ... restore database newdb... +phd-influx:~# systemctl start influxd