How can I use as much disk space as possible in MySql automatically?
Hi.
I have a service that create a MySql database everyday. And the every database will be filled with about 40G data after created. These databases are located in /data/mysql_data now. There is no doubt that /dev/sda4 will be full after decades of days. But as you can see below, I still has a lot spaces in /dev/sdb and /dev/sdc. My question is: what's the best way to make MySql to use /dev/sdb (and then /dev/sdc) automatically after /dev/sda4 is full? df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 9.9G 4.9G 4.5G 53% / /dev/sda3 20G 812M 18G 5% /usr/local /dev/sda4 885G 220G 621G 27% /data tmpfs 3.9G 68K 3.9G 1% /dev/shm /dev/sdb 3.6T 783G 2.8T 22% /data1 /dev/sdc 3.6T 924G 2.7T 26% /data2 Thx a lot! |
A solution might be: making some soft links in /data/mysql_data when realizing there is not enough spaces in /data/, and located data files in another disk. But I think this might be not the best way. And the disadvantages are:
1. I cann't drop databases as before. 2. such shell script is kind of complicated, and I am not sure it will work in every context. |
Simplest way would be to use a volume group that combines all of the drives together.
|
Quote:
I havn't used or even known "volume group" yet. And I have searched and learned some of it. http://www.centos.org/docs/5/html/Cl...ger/index.html I wonder whether the original data(or the other service that running on this machine but having no idea that a volumn group has been created) would be affected after I created a volume group? |
You'd have to backup the DB and start over.
The LV/VG/PVs sit under the FS, so you also have mkfs.ext4 then put the DB etc back. IOW: pv+pv+pv... = VG then carve into one (or more) LVs, then mkfs ontop of each LV, then install App SW. HTH PS I note that Section 5.1 of that link says '5.1. Creating an LVM Logical Volume on Three Disks', so follow that step by step AFTER taking 2(!) backups and checking them. |
Quote:
But thank you all the same! |
All times are GMT -5. The time now is 10:09 PM. |