-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#139 renewed backup/restore influxdb containers
- Loading branch information
Showing
4 changed files
with
66 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
# See https://www.influxdata.com/blog/backuprestore-of-influxdb-fromto-docker-containers/ | ||
# NB need to stop monitoring as influxdb will not stop because of cAdvisor lock!!! | ||
|
||
SCRIPT_DIR=${0%/*} | ||
|
||
pushd ${SCRIPT_DIR} | ||
if [ ! -f influxdb.env ] | ||
then | ||
echo "Bestand influxdb.env niet gevonden." | ||
exit 1 | ||
fi | ||
source influxdb.env | ||
popd | ||
|
||
# On RUNNING container named influxdb | ||
INFLUX_CMD="docker exec ${SE_CONTAINER_NAME} influx -host 127.0.0.1 -port 8086 -database ${INFLUXDB_DB} -username ${INFLUXDB_ADMIN_USER} -password ${INFLUXDB_ADMIN_PASSWORD} -execute " | ||
|
||
echo "DROP DATABASE ${INFLUXDB_DB}..." | ||
${INFLUX_CMD} "DROP DATABASE ${INFLUXDB_DB}" | ||
|
||
# Permissions are somehow not set, users should still exist | ||
echo "Restore permissions for users ${INFLUXDB_READ_USER} and ${INFLUXDB_WRITE_USER} ..." | ||
${INFLUX_CMD} "GRANT READ ON ${INFLUXDB_DB} TO ${INFLUXDB_READ_USER}" | ||
${INFLUX_CMD} "GRANT ALL ON ${INFLUXDB_DB} TO ${INFLUXDB_WRITE_USER}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters