Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datadir to a different location #25

Closed
stissot opened this issue Oct 19, 2014 · 5 comments
Closed

datadir to a different location #25

stissot opened this issue Oct 19, 2014 · 5 comments

Comments

@stissot
Copy link
Contributor

stissot commented Oct 19, 2014

When the attribute node['mariadb']['mysqld']['datadir'] is set to a non-default value (e.g /mnt/mysql), the server fails to start because the data is not copied from the default location /var/lib/mysql
Tested on Ubuntu 14.04 with MariaDB 5.5

@sinfomicien
Copy link
Contributor

The question is, must we copy or move the data automatically ? That's why today it's not done... Can't decide what is the best strategy

@stissot
Copy link
Contributor Author

stissot commented Oct 20, 2014

It's difficult to change the datadir in the my.cnf during the package installation. I suggest to keep it to it's default value, but if the node['mariadb']['mysqld']['datadir']is different than the default, stop the service, move the data, replace it with a symlink to the new path and restart the service.

@stissot
Copy link
Contributor Author

stissot commented Oct 20, 2014

Hello I've added in a separate branch a shell script that moves the datadir just after install and replaces it by a symlink. I tried to use service[mysql] to stop the service but it takes several seconds for the server to be properly shut down and the execute command that moves the directory was notified too quickly so in the end everything is done in the shell script.
A new serverspec test was added that pass on Ubuntu 14.04 with MariaDB 10.0, didn't had time to verify on the other platforms.

sinfomicien added a commit that referenced this issue Oct 24, 2014
[Feature] Move datadir after install (issue #25)
@sinfomicien
Copy link
Contributor

I checked on other platform, and it works. Thx for your PR. I closed the ticket, fell free to reopen if needed

@lock
Copy link

lock bot commented Jul 24, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants