MySQL Ramdisk: systemd-managed, custom data directory
Strength: Participate in systemd process supervision.
Weakness: Only works on systems with systemd. More manual config.
test-ubu1204-5 is actually an Ubuntu 14.04 server, on which the systemd package was installed. It's not really clear what systemd does, but at least journalctl -f works. It doesn't seem to work for launching processes.
mysql_install_dbchgrp mysql /mnt/mysqlchmod g+rw /mnt/mysqladduser jenkins mysql
I wasn't sure if buildkit would allow using a DSN with an empty root password, so I ran:
On test-ubu1204-5, the ramdisk uses this arrangement:
Declare a ramdisk for /mnt/mysql in /etc/fstab. This allows it to startup during boot without any special user-privileges. (No root or sudo.)
The jenkins user has amp config set with these options:
| db_type | mysql_ram_disk | How to connect to the database as admin [mysql_dsn,mysql_mycnf,mysql_ram_disk,mysql_osx_ram_disk,pg_dsn] |
| ram_disk_dir | /mnt/mysql | Directory to create as a RAM disk |
| ram_disk_size | 500 | Amount of space to allocate for ramdisk (MB) |
| ram_disk_type | manual | Type of RAM disk [auto,linux,osx,manual] |
db_type=mysql_ram_disk means that amp will auto-create the mysql data files and start the mysqld (on-demand)
ram_disk_dir=/mny/mysql and ram_disk_type=manual means that it will use the ramdisk that's been already created. (By default, mysql_ram_disk tries to create a new ramdisk, but that requires root/sudo on Linux, so we don't use it on the shared server)
Amp boots MySQL on demand, when the user runs civibuild or amp create.