Difference between revisions of "Influxdb one-liners"
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
# V2 | # V2 | ||
+ | docker exec -it <mycontainername> bash | ||
+ | influx backup bkp-all | ||
+ | influx restore --host https://influxdb.example.com --bucket loadtesting/autogen --new-bucket loadtesting-2021-05-to-09 --token xxx bkp-all/ | ||
+ | |||
+ | |||
+ | ``` | ||
+ | # docker run -d --name=influxdb-a1 -p 8086:8086 -p 8088:8088 -v C://sandbox/influxdb/influxdb-data:/root/.influxdb-data influxdb:1.8 | ||
+ | |||
+ | exit | ||
+ | |||
+ | docker run -p 8086:8086 ` | ||
+ | -v $PWD/influxdb:/var/lib/influxdb ` | ||
+ | -v $PWD/influxdb.conf:/etc/influxdb/influxdb.conf:ro ` | ||
+ | -v $PWD/influxdb2:/var/lib/influxdb2 ` | ||
+ | -e DOCKER_INFLUXDB_INIT_MODE=upgrade ` | ||
+ | -e DOCKER_INFLUXDB_INIT_USERNAME=myuser ` | ||
+ | -e DOCKER_INFLUXDB_INIT_PASSWORD=mypassword123 ` | ||
+ | -e DOCKER_INFLUXDB_INIT_ORG=myorg ` | ||
+ | -e DOCKER_INFLUXDB_INIT_BUCKET=mybucket ` | ||
+ | influxdb:2.4 | ||
+ | ``` |
Revision as of 01:27, 12 September 2022
V1
influxd-v1 backup -portable -host 10.x.x.x:8088 -db loadtesting bkp-influxdb-10.x.x.x-loadtesting influxd restore -portable -db loadtesting .influxdb-data/
V2
docker exec -it
# docker run -d --name=influxdb-a1 -p 8086:8086 -p 8088:8088 -v C://sandbox/influxdb/influxdb-data:/root/.influxdb-data influxdb:1.8 exit docker run -p 8086:8086 ` -v $PWD/influxdb:/var/lib/influxdb ` -v $PWD/influxdb.conf:/etc/influxdb/influxdb.conf:ro ` -v $PWD/influxdb2:/var/lib/influxdb2 ` -e DOCKER_INFLUXDB_INIT_MODE=upgrade ` -e DOCKER_INFLUXDB_INIT_USERNAME=myuser ` -e DOCKER_INFLUXDB_INIT_PASSWORD=mypassword123 ` -e DOCKER_INFLUXDB_INIT_ORG=myorg ` -e DOCKER_INFLUXDB_INIT_BUCKET=mybucket ` influxdb:2.4