dokku / dokku-mariadb

a mariadb plugin for dokku
MIT License
73 stars 26 forks source link

How to configure my.cnf #52

Closed Sacristan closed 7 years ago

Sacristan commented 8 years ago

Hi!

I would like to configure innodb_buffer_pool_size . Is this configurable somehow.

I usually update it @ /etc/mysql/my.cnf for Wordpress Digitalocean VPSes

But for docker im not quite sure where to do that.

root@creative:~# locate my.cnf /var/lib/docker/aufs/diff/66978a415c79686619b2999bab3338fb05aa505f032d032a13bd9132d40440af/etc/mysql/my.cnf /var/lib/docker/aufs/diff/86fd8e7b9fca2d7999ef3a524e4470941c64a9542f2b4d3aab818378716f908c/etc/mysql/my.cnf /var/lib/docker/aufs/diff/bae39a7a3d4407dc5d7dea3750d6504c3bc2bb778623eca20189b23cee14e899/etc/mysql/my.cnf /var/lib/docker/aufs/diff/bae39a7a3d4407dc5d7dea3750d6504c3bc2bb778623eca20189b23cee14e899/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf /var/lib/docker/aufs/diff/eedacc43acd02e38fd1a142e8a4f06c539b550a2e516e7c54a32f715f6b2a154/etc/mysql/my.cnf /var/lib/docker/aufs/diff/fecfc185bfdffd32718f317bb291f1cc60bbd4e48af6ff994e9ea16394281224/etc/mysql/my.cnf /var/lib/docker/aufs/diff/fecfc185bfdffd32718f317bb291f1cc60bbd4e48af6ff994e9ea16394281224/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf /var/lib/docker/aufs/mnt/14eaa86df27268627a37d73502eed9d224ee8ccee866f3c3285624ec7de0142d/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/288bafabce28d53fafe731c0abefc43543d2ddb4c6bc412a3bb3138de9ff2c9d/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/288bafabce28d53fafe731c0abefc43543d2ddb4c6bc412a3bb3138de9ff2c9d/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf /var/lib/docker/aufs/mnt/2c5d3a751c36f58374c18b14ff078c2424c29a9de8179ea044a0ee85179d3277/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/2c5d3a751c36f58374c18b14ff078c2424c29a9de8179ea044a0ee85179d3277/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf /var/lib/docker/aufs/mnt/41d669f6b3af325b1d4191ff7a6acaf40c59a219262db149cdfe1deeaab56073/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/641403e5b5e4489404feddb34368cecf8c4cee29368e651427667bdabf0909c6/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/641403e5b5e4489404feddb34368cecf8c4cee29368e651427667bdabf0909c6/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf /var/lib/docker/aufs/mnt/7ebe0235653c4fea9be013d0aa4b42075465dbcaf42745421af5fd0218de32e4/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/81aef3c69b1907c467c24fa305105c11a2236c1fbfba5500f481445b70cbfb90/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/81aef3c69b1907c467c24fa305105c11a2236c1fbfba5500f481445b70cbfb90/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf /var/lib/docker/aufs/mnt/cb2edc194593a897e2bb7e53cf232ff867594ca2012fe86a1b77117fe64f51eb/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/f1cfd174edd4cedb75fa81254481a409ae65eff94c5cfd42e56b7093127ca682/etc/mysql/my.cnf /var/lib/docker/aufs/mnt/f1cfd174edd4cedb75fa81254481a409ae65eff94c5cfd42e56b7093127ca682/etc/systemd/system/mariadb.service.d/migrated-from-my.cnf-settings.conf

When i run doker ps i see mariab containers for each blog container. Im not quite sure where to look for my.cnf

➜ ~ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 58ecf780fe59 dokku/blog.stockholmhealth.com:latest "/start web" 7 minutes ago Up 7 minutes blog.stockholmhealth.com.web.1 cc5d4cf4cf15 dokku/skaistumanoslepums.lv:latest "/start web" 22 hours ago Up 22 hours skaistumanoslepums.lv.web.1 fc4d5e252359 mariadb:10.1.13 "/docker-entrypoint.s" 22 hours ago Up 22 hours 3306/tcp dokku.mariadb.skaistumanoslepums.lv 8fb23aa02b5f dokku/uz-veselibu.lv:latest "/start web" 22 hours ago Up 22 hours uz-veselibu.lv.web.1 11e7c8bb5f0e dokku/blog.swisslanguages.com:latest "/start web" 23 hours ago Up 23 hours blog.swisslanguages.com.web.1 bf344ed59f00 mariadb:10.1.13 "/docker-entrypoint.s" 29 hours ago Up 29 hours 3306/tcp dokku.mariadb.blog.stockholmhealth.com a4cd8d9f820f dokku/blog:latest "/start web" 4 days ago Up 4 days blog.web.1 694494f0241b mariadb:10.1.13 "/docker-entrypoint.s" 4 days ago Up 4 days 3306/tcp dokku.mariadb.uz-veselibu.lv 75b9a0618ca6 mariadb:10.1.13 "/docker-entrypoint.s" 4 days ago Up 4 days 3306/tcp dokku.mariadb.blog.swisslanguages.com 0e9df5bd0fee mariadb:10.1.13 "/docker-entrypoint.s" 4 days ago Up 4 days 3306/tcp dokku.mariadb.blog

Epigene commented 8 years ago

Ability to specify database configuration would be handy indeed. MySQL docs speak of config for mysqld. How would configuration persist in container context?

themandoug commented 8 years ago

Hi,

Has there been any further progress on this?

I need to configure SSL and table encryption properties. I can locate the my.cnf in the container itself although I don't know how persistent it is if I make changes to it directly.

Thanks, Paul

josegonzalez commented 8 years ago

We only currently mount a host directory for /var/lib/mysql. We would take a pr to add support for /etc/mysql/conf.d, or you can sponsor the work so it can be done faster.

crisward commented 7 years ago

If there are no plans to do this soon, I'll take a look at doing a pull request. Could do with tweaking some settings for performance reasons ie. innodb_buffer_pool_size.

I'm guessing mapping a volume to /var/lib/dokku/services/mariadb/APP/conf.d/ would do it, along with pre-populating it with the defaults.

crisward commented 7 years ago

@josegonzalez, taking a look at this, I've added the volume to my fork, however I noticed the plugin already seems to create a config directory here https://github.com/dokku/dokku-mariadb/blob/master/functions#L24 just wondering what this is for?

josegonzalez commented 7 years ago

No use atm, but we could use it for this. Can you also make the same pr for mysql?

crisward commented 7 years ago

I've done a pr for this, checked mysql and it already seems to have it. https://github.com/dokku/dokku-mysql/blob/master/functions#L48

josegonzalez commented 7 years ago

The /etc/mysql/conf.d directory is now mounted, so you should be able to just add whatever you want into it.