influxdata / influxdata/influxdata-docker

Unable to output influxd.log.

Open
#822 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
364
Forks
255
Avg merge
3h 18m
Merged PRs (30d)
7

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:
1. Get inside the container `docker exec -it influxdb bash`
2. `influxd > /var/log/influxdb/influxdb.log 2>&1 &`
3. 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:

1. 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"

```
2. give all priviledges to the directories

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the supplied docker run command and mounted influxdb.conf, then reproduce the configuration using the influxdb:1.8 image. Compare the working access.log setting with the logging.file setting and check whether influxdb.log is created in the mounted /var/log/influxdb directory. Done means the daemon writes influxdb.log there without manually starting a second process.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.