Moving database data directory to its own drive

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Moving database data directory to its own drive

Postby alo » Sun Mar 11, 2018 10:41 pm

This may be more of a OpenSuSE Question, but I noticed Matt and others recommended putting database data directory on a separate physical drive partition from the rest of the Linux filesystem. Well I added a second drive and I see it and I can mount it, but If I mount it to the existing /srv/mysql Directory it just sits there and doesn't move database files to the directory.

Anyone know the best way to put the database data directory on this new separate physical drive partition?
Is it as simple as mounting the hard drive and then moving the files to the new Partition?

Thanks a bunch guys.

Vicibox 8.0.1
VERSION: 2.14-656a
BUILD: 180215-1318
SVN 2918
DB Schema Version: 1536
Asterisk 11.25.3-vici
Single server DB/Web/dialer
25 agents
webrtc Viciphone
alo
 
Posts: 187
Joined: Wed Jun 20, 2012 10:21 am

Re: Moving database data directory to its own drive

Postby williamconley » Sun Mar 11, 2018 11:07 pm

Mounting a drive in a folder in NO way "communicates a need to copy files" to that folder.

Steps:

1) Mount the drive in /mnt (or some other innocuous location)
2) Shut down mysql
3) Move the files to the /mnt folder (not a sub-folder of /mnt, but in the /mnt folder itself if that's where you mounted the drive).
4) Remount the drive in the mysql folder, which should now be EMPTY because you moved all the files .. until after you remount the drive, of course, then they will magically reappear cuz that's where you put them!
5) Re-start mysql ... which will start up normally because as far as it's concerned the files never moved.

Obviously it's recommended to back up the entire mysql system (all databases) before you do this. It's not a bad idea to be very familiar with Linux and MySQL before attempting such a trick.

In this case, I'd highly recommend you practice on another server first. Perhaps a virtual one. It's easy once you know how, but it's equally easy to screw up and break something. Get that backup, get it OFF the Vicidial server, and test-restore it on another instance of MySQL to be certain it's valid (a backup set that has never been tested to be valid is actually a trap 8-) ).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Moving database data directory to its own drive

Postby alo » Mon Mar 26, 2018 10:35 pm

This was quick and easy and painless. No sure if I notice much of a performance increase, But Its running fine!

Thank you very much!
alo
 
Posts: 187
Joined: Wed Jun 20, 2012 10:21 am

Re: Moving database data directory to its own drive

Postby williamconley » Tue Mar 27, 2018 9:21 am

alo wrote:This was quick and easy and painless. No sure if I notice much of a performance increase, But Its running fine!

Thank you very much!

The improvement is only notable during seriously heavy usage when it would otherwise slow down the system. At that point, you are ordinarily too busy to be checking on the DB server ... unless it's crashing. lol
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Support

Who is online

Users browsing this forum: No registered users and 56 guests