-
Notifications
You must be signed in to change notification settings - Fork 250
Open
Description
When I deploy influx:1.8 and 1.11 , I want to mount the log files(access.log and influxdb.log) to local directory. I tried many ways however in vain. But I did successfully output access.log and mount it. I am sure that the the problem is in the configration. Because I created a file(test.log) inside the contianer at /var/log/influxdb/ and I can see the test.log in my host machine.
And I did find a way to achieve this function but its not recommended:
- Get inside the container
docker exec -it influxdb bash influxd > /var/log/influxdb/influxdb.log 2>&1 &- After this operation , the influxdb.log is able to be accessed both in the container and host machine.
This is my deploy code:
deploy code
docker run -d \
--name influxdb \
-p 8086:8086 \
-v /data/soft/influxdb1.8/data:/var/lib/influxdb \
-v /data/soft/influxdb1.8/config/influxdb.conf:/etc/influxdb/influxdb.conf \
-v /data/soft/influxdb1.8/log:/var/log/influxdb \
influxdb:1.8 -config /etc/influxdb/influxdb.conf
ways I tried
These are the ways I tried:
- change infuxdb.conf:
reporting-disabled = true
[meta]
dir = "/var/lib/influxdb/meta"
retention-autocreate = true
logging-enabled = true
[data]
dir = "/var/lib/influxdb/data"
wal-dir = "/var/lib/influxdb/wal"
query-log-enabled = true
cache-max-memory-size = "1g"
cache-snapshot-memory-size = "25m"
cache-snapshot-write-cold-duration = "10m"
compact-full-write-cold-duration = "4h"
max-series-per-database = 1000000
max-values-per-tag = 100000
[http]
enabled = true
bind-address = ":8086"
auth-enabled = false
log-enabled = true
access-log-path = "/var/log/influxdb/access.log"
[logging]
level = "info"
file = "/var/log/influxdb/influxdb.log"
[retention]
enabled = true
check-interval = "30m"
- give all priviledges to the directories
Metadata
Metadata
Assignees
Labels
No labels