Docker Community Forums

Share and learn in the Docker community.

Trying to link volumes to another path

I,

I’m trying to install the Percona Monitor Manager.

The official installation, says to run a dummy container as:

$ docker create
-v /opt/prometheus/data
-v /opt/consul-data
-v /var/lib/mysql
-v /var/lib/grafana
–name pmm-data
percona/pmm-server:1 /bin/true

docker run -d -p 80:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server

But I don’t know at all, where are mapping the volumes. But this is working perfect.

I’m trying the next:

docker create
-v /data/prometheus/data:/opt/prometheus/data
-v /data/consul-data:/opt/consul-data
-v /data/mysql:/var/lib/mysql
-v /data/grafana:/var/lib/grafana
–name pmm-data percona/pmm-server /bin/true

docker run -d -p 80:80 --volumes-from pmm-data --name pmm-server --restart always percona/pmm-server

Or maping the volumes with docker-composer:

services:
percona:
image: percona/pmm-server
restart: always
ports:

  • 80:80
    volumes:
  • /data/prometheus/data:/opt/prometheus/data
  • /data/consul-data:/opt/consul-data
  • /data/mysql:/var/lib/mysql
  • /data/grafana:/var/lib/grafana

But in the two cases, isn’t working.

The docker is wrtting some files in the volumes:

root@perconamm:/data# ls -la *
consul-data:
total 8
drwxr-xr-x 2 root root 4096 May 29 23:04 .
drwxrwxrwx 6 root root 4096 May 29 23:04 …

grafana:
total 12
drwxr-xr-x 3 root root 4096 May 29 23:04 .
drwxrwxrwx 6 root root 4096 May 29 23:04 …
-rw-r–r-- 1 root root 0 May 29 23:04 grafana.db
drwxr-xr-x 3 root root 4096 May 30 07:31 plugins

mysql:
total 8
drwxr-xr-x 2 root root 4096 May 29 23:04 .
drwxrwxrwx 6 root root 4096 May 29 23:04 …

prometheus:
total 12
drwxr-xr-x 3 root root 4096 May 29 23:04 .
drwxrwxrwx 6 root root 4096 May 29 23:04 …
drwxr-xr-x 2 root root 4096 May 29 23:04 data
root@perconamm:/data#

But container seems doesnt work correctly, and seems not have the option to write correct. (I tryed also chmod -R 777 * to do all permisions to the files.

The logs shows:

2019-05-30 07:33:07,541 INFO spawned: ‘dashboard-upgrade’ with pid 12318
2019-05-30 07:33:07,543 INFO success: dashboard-upgrade entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-05-30 07:33:07,544 INFO exited: grafana (exit status 1; not expected)
2019-05-30 07:33:08,012 INFO exited: createdb (exit status 1; not expected)
2019-05-30 07:33:09,016 INFO spawned: ‘createdb’ with pid 12326
2019-05-30 07:33:09,223 INFO exited: qan-api (exit status 1; not expected)
2019-05-30 07:33:10,227 INFO spawned: ‘qan-api’ with pid 12335
2019-05-30 07:33:10,228 INFO success: createdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-05-30 07:33:10,334 INFO exited: createdb2 (exit status 1; not expected)
2019-05-30 07:33:11,336 INFO success: qan-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-05-30 07:33:11,339 INFO spawned: ‘createdb2’ with pid 12339
2019-05-30 07:33:11,342 INFO spawned: ‘pmm-managed’ with pid 12340
2019-05-30 07:33:11,373 INFO exited: pmm-managed (exit status 2; not expected)
2019-05-30 07:33:11,430 INFO exited: createdb3 (exit status 1; not expected)
2019-05-30 07:33:12,432 INFO success: createdb2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-05-30 07:33:12,434 INFO spawned: ‘createdb3’ with pid 12351
2019-05-30 07:33:12,869 INFO spawned: ‘grafana’ with pid 12354
2019-05-30 07:33:12,912 INFO exited: grafana (exit status 1; not expected)
2019-05-30 07:33:13,914 INFO success: createdb3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-05-30 07:33:13,944 INFO exited: dashboard-upgrade (exit status 1; not expected)
2019-05-30 07:33:14,108 INFO spawned: ‘dashboard-upgrade’ with pid 12361
2019-05-30 07:33:14,110 INFO success: dashboard-upgrade entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2019-05-30 07:33:14,111 INFO exited: createdb (exit status 1; not expected)
2019-05-30 07:33:14,315 INFO spawned: ‘createdb’ with pid 12367
2019-05-30 07:33:15,244 INFO exited: qan-api (exit status 1; not expected)
2019-05-30 07:33:16,248 INFO spawned: ‘qan-api’ with pid 12376
2019-05-30 07:33:16,249 INFO success: createdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-05-30 07:33:16,361 INFO exited: createdb2 (exit status 1; not expected)
2019-05-30 07:33:17,363 INFO success: qan-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-05-30 07:33:17,365 INFO spawned: ‘createdb2’ with pid 12380
2019-05-30 07:33:17,447 INFO exited: createdb3 (exit status 1; not expected)
2019-05-30 07:33:18,449 INFO success: createdb2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-05-30 07:33:18,450 INFO spawned: ‘createdb3’ with pid 12384
2019-05-30 07:33:19,342 INFO exited: createdb (exit status 1; not expected)
2019-05-30 07:33:19,441 INFO spawned: ‘createdb’ with pid 12389
2019-05-30 07:33:19,453 INFO spawned: ‘grafana’ with pid 12390

That is the software im ussing:

root@perconamm:~# docker-compose -v
docker-compose version 1.24.0, build 0aa59064
root@perconamm:~# docker --version
Docker version 18.09.6, build 481bc77
root@perconamm:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 9.9 (stretch)
Release: 9.9
Codename: stretch

Many thanks!

Hello all,
Can anyone help me, please ?

hello, this is a up of the post.
Can anyone help me, please ?

Hello all,
Can anyone help me, please ?