# how to use local pmm-data volume

**URL:** <https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364>\
**Category:** PMM 1.x\
**Created:** [May 17, 2018, 11:06am UTC](https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364 "2018-05-17T11:06:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcio](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@marcio](https://forums.percona.com/u/marcio)\
**Post date:** [May 17, 2018, 11:06am UTC](https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364/1 "2018-05-17T11:06:13Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rnmkr](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@rnmkr](https://forums.percona.com/u/rnmkr)\
**Post date:** [November 14, 2018, 12:39pm UTC](https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364/2 "2018-11-14T12:39:16Z")

</div>

Having same problem here! Only mysql complaining and won’t even start up. Did you ever solve this issue?  
I wonder if we use local volume for prometheus, grafana, consul only and leave mysql alone, what data will be lost?

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [November 14, 2018, 4:49pm UTC](https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364/3 "2018-11-14T16:49:02Z")

</div>

Hi [rnmkr](https://percona.vanillacommunities.com/profile/x/x/42461)

We definitely need the data to persist for MySQL, otherwise Query Analytics will be completely broken.

[marcio](https://percona.vanillacommunities.com/profile/x/x/41721)

Can you get the MySQL error log? If mysqld isn’t running then those createdb, qan-api jobs will fail since they depend on MySQL. Directory permissions are correct?

We don’t officially support host volumes, we recommend creation of a pmm-data container as documented: [url][Percona Monitoring and Management](https://www.percona.com/doc/percona-monitoring-and-management/deploy/server/docker.setting-up.html#data-container%5B/url%5D) . Having said that I don’t see why it shouldn’t work, so share with us the logs and we’ll review. Thanks

---

<div class="post-metadata">

**Author:** ![rnmkr](https://avatars.discourse-cdn.com/v4/letter/r/f9ae1b/32.png) [@rnmkr](https://forums.percona.com/u/rnmkr)\
**Post date:** [November 14, 2018, 8:59pm UTC](https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364/4 "2018-11-14T20:59:32Z")

</div>

Because there is no such thing as “docker volumes” in kubernetes or any other container orchecstration.

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [November 14, 2018, 9:10pm UTC](https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364/5 "2018-11-14T21:10:17Z")

</div>

Thanks for the information [rnmkr](https://percona.vanillacommunities.com/profile/x/x/42461) - do none of these apply to your environment? [url][Volumes | Kubernetes](https://kubernetes.io/docs/concepts/storage/volumes/#types-of-volumes%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![fward1208](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fward1208/32/1249_2.png) [@fward1208](https://forums.percona.com/u/fward1208)\
**Post date:** [December 23, 2018, 7:02pm UTC](https://forums.percona.com/t/how-to-use-local-pmm-data-volume/6364/6 "2018-12-23T19:02:40Z")

</div>

I found this article very helpful for using mapped storage instead of the docker storage

[url][https://www.percona.com/blog/2018/03/20/using-different-mount-points-on-pmm-docker-deployments/[/url]](https://www.percona.com/blog/2018/03/20/using-different-mount-points-on-pmm-docker-deployments/%5B/url%5D)
