Not the answer you need?
Register and ask your own question!

how to use local pmm-data volume

marciomarcio ContributorCurrent User Role Contributor
Hi guys!
I have a instance of pmm-server and pmm-data working fine, both in docker. All right.

For a new instance, I'm trying use a local volume on host server to store only the pmm-data.
I created the local folders ( /opt/consul-data, /opt/prometheus, /var/lib/grafana, /var/lib/mysql ) and when start the pmm-server, I have trouble with mysql:

#docker run -p 9080:80 -p 9443:443 --volume /root/docker/volumes/var/lib/mysql:/var/lib/mysql --volume /root/docker/volumes/opt/consul-data:/opt/consul-data --volume /root/docker/volumes/opt/prometheus:/opt/prometheus --volume /root/docker/volumes/var/lib/grafana:/var/lib/grafana --name pmm-server -e METRICS_RETENTION=190h -e QUERIES_RETENTION=7 -e SERVER_USER=srv143 -e SERVER_PASSWORD=password0 -e METRICS_RESOLUTION=5s --restart always percona/pmm-server:latest

See messages from container log:
2018-05-17 16:16:01,187 INFO exited: createdb2 (exit status 1; not expected),
2018-05-17 16:16:01,208 INFO spawned: 'createdb2' with pid 2889,
2018-05-17 16:16:02,048 INFO spawned: 'pmm-managed' with pid 2908,
2018-05-17 16:16:02,061 INFO exited: pmm-managed (exit status 2; not expected),
2018-05-17 16:16:02,196 INFO success: mysql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:02,196 INFO exited: createdb3 (exit status 1; not expected),
2018-05-17 16:16:03,049 INFO success: createdb2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:03,051 INFO spawned: 'createdb3' with pid 2918,
2018-05-17 16:16:03,082 INFO exited: mysql (exit status 1; not expected),
2018-05-17 16:16:04,085 INFO spawned: 'mysql' with pid 2920,
2018-05-17 16:16:04,085 INFO success: createdb3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:04,203 INFO exited: createdb (exit status 1; not expected),
2018-05-17 16:16:04,229 INFO spawned: 'createdb' with pid 2934,
2018-05-17 16:16:04,386 INFO exited: qan-api (exit status 1; not expected),
2018-05-17 16:16:04,732 INFO spawned: 'qan-api' with pid 2942,
2018-05-17 16:16:05,793 INFO success: mysql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:05,793 INFO success: qan-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:05,793 INFO success: createdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:05,816 INFO exited: mysql (exit status 1; not expected),
2018-05-17 16:16:06,229 INFO spawned: 'mysql' with pid 2954,
2018-05-17 16:16:06,231 INFO exited: createdb2 (exit status 1; not expected),
2018-05-17 16:16:06,253 INFO spawned: 'createdb2' with pid 2956,
2018-05-17 16:16:08,071 INFO success: mysql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:08,071 INFO success: createdb2 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:08,077 INFO exited: createdb3 (exit status 1; not expected),
2018-05-17 16:16:08,105 INFO spawned: 'createdb3' with pid 2978,
2018-05-17 16:16:08,106 INFO exited: mysql (exit status 1; not expected),
2018-05-17 16:16:09,109 INFO spawned: 'mysql' with pid 2980,
2018-05-17 16:16:09,109 INFO success: createdb3 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:09,236 INFO exited: createdb (exit status 1; not expected),
2018-05-17 16:16:09,274 INFO spawned: 'createdb' with pid 2994,
2018-05-17 16:16:09,743 INFO exited: qan-api (exit status 1; not expected),
2018-05-17 16:16:09,775 INFO spawned: 'qan-api' with pid 3002,
2018-05-17 16:16:10,836 INFO success: mysql entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:10,836 INFO success: qan-api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),
2018-05-17 16:16:10,836 INFO success: createdb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs),

If I not use the volume mount for mysql, the container works fine, but I wont save the mysql data on local host.

#docker run -p 9080:80 -p 9443:443 --volume /root/docker/volumes/opt/consul-data:/opt/consul-data --volume /root/docker/volumes/opt/prometheus:/opt/prometheus --volume /root/docker/volumes/var/lib/grafana:/var/lib/grafana --name pmm-server -e METRICS_RETENTION=190h -e QUERIES_RETENTION=7 -e SERVER_USER=srv143 -e SERVER_PASSWORD=password0 -e METRICS_RESOLUTION=5s --restart always percona/pmm-server:latest

Does how to address this issue with mysql ?

BR

--note added by Percona Community Manager, going forward using pmm-server:n rather than pmm-server:latest is best practice, our advice changed since this post was written. In this case pmm-server:1 would have been appropriate for these code examples.

Comments

Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.