Skip to content

Commit c84f52e

Browse files
committed
updates to data persist section
1 parent 14e812c commit c84f52e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

influxdb/content.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ Once the container is running, generate an admin token and create a database:
2424

2525
```bash
2626
docker exec -it influxdb3-core influxdb3 generate token --admin
27+
```
28+
29+
```bash
2730
docker exec -it influxdb3-core influxdb3 create database my_db --token <your_admin_token>
2831
```
2932

@@ -67,16 +70,25 @@ To persist **InfluxDB 3 Core** data across container restarts, mount a Docker vo
6770

6871
### Using a Docker volume
6972

73+
To persist data using a Docker-managed volume, run the following command:
74+
7075
```bash
7176
docker run -d --name influxdb3-core \
7277
-v influxdb3-data:/var/lib/influxdb3 \
7378
-p 8086:8086 \
7479
quay.io/influxdb/influxdb3:latest \
7580
serve --host-id my-influxdb-node --object-store file --data-dir /var/lib/influxdb3
7681
```
82+
This command:
83+
84+
- Creates or reuses a Docker volume named `influxdb3-data`.
85+
- Maps the default InfluxDB port (`8086`) to your local machine.
86+
- Starts the InfluxDB server with a required host ID and object store configuration.
7787

7888
### Using a local host directory
7989

90+
To persist data in a local directory on your host, use the following command:
91+
8092
```bash
8193
docker run -d --name influxdb3-core \
8294
-v $PWD/influxdb3-data:/var/lib/influxdb3 \
@@ -85,7 +97,7 @@ docker run -d --name influxdb3-core \
8597
serve --host-id my-influxdb-node --object-store file --data-dir /var/lib/influxdb3
8698
```
8799

88-
Ensure the directory exists and has appropriate write permissions.
100+
This mounts a local folder named `influxdb3-data` in your current working directory. Ensure that this directory exists and has appropriate write permissions.
89101

90102
# What is InfluxDB?
91103

0 commit comments

Comments
 (0)