Metricbeat docker fail to start under not a root user

Hi Team,
Task is set-up Docker containers monitoring using Metricbeat container.
I am following YAML file as mentioned in this article and trying to use my metricbeat.docker.yml but not able to use --user=root as I am getting error :grimacing: :

Exiting: error loading config file: config file ("metricbeat.yml") must be owned by the beat user (uid=0) or root

In case when I use --user=$(id -u) , I am getting error:

/usr/local/bin/docker-entrypoint: line 13: metricbeat: command not found

What you would recommend (if i am not able to use root user)?

Command looks like this:
docker run -it
--name=docker-metricbeat-25
--user=$(id -u)
--volume="$HOME/selenoid/elastic/metricbeat.docker.ccs.yml:/usr/share/metricbeat/metricbeat.yml:ro"
--volume="/var/run/docker.sock:/var/run/docker.sock:ro"
--volume="/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro"
--volume="/proc:/hostfs/proc:ro"
mydockerhub/beats/metricbeat-oss:6.6.2 metricbeat -e
-E output.elasticsearch.hosts=["my-host"]

Solved with: https://www.elastic.co/guide/en/beats/libbeat/6.6/config-file-permissions.html

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.