ca2236

Well-Known Member
Feb 2, 2018
229
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hello,

I know this is more a centos question than a cpanel question, however, our server is getting low on space on our partition format. I've traced it down to the mysql databases and backups that are happening for the sites.

Since this machine is a vm, I was able to add a new partition easy enough.

Here are my questions:

1) since the mysql directory is technically on an lvm partition, is there any danger in forcing that partition to mount (via fstab and normal means) to the new drive, which would probably not be added into the lvm partition scheme (unless it should be done)

2) since it the mysql databases and backups, I presume there would be a setting that I need to change in cpanel settings?


I will continue doing more research, but I thought I would ask the experts here.

Thanks
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
Hi @ca2236


1) since the mysql directory is technically on an lvm partition, is there any danger in forcing that partition to mount (via fstab and normal means) to the new drive, which would probably not be added into the lvm partition scheme (unless it should be done)
I can't speak for your specific configuration but the following forum threads have addressed similar issues and may be useful for you:

the proper way to move mysql to a second drive
how to move mysql data directory

2) since it the mysql databases and backups, I presume there would be a setting that I need to change in cpanel settings?
If the instructions to move the MySQL to a different drive are followed there shouldn't be anything necessary to modify for that, if backups are also going to be moved to this drive you may want to modify the backup configuration at WHM>>Backup>>Backup Configuration to store the backups on the new drive.


Thank you,
 

ca2236

Well-Known Member
Feb 2, 2018
229
22
18
Nebraska
cPanel Access Level
DataCenter Provider
Hello,

Thanks for your reply. I found it really helpful. :) I have a couple of follow up questions if I may.

1) Since it appears that there are logs in the domlogs in /var/logs for the time period where the account was over quota. Does that mean, apache is logging the connections still under /var/log, but it can't write back to the account for awstats due to the account being over quota?

2) if we use log rotation for the domlogs or the logs that the metrics come from, does the rotated out data not exist in the metric history? I would assume so, but wanted to check.


Thanks
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
I'm really happy you found it helpful!

1) Since it appears that there are logs in the domlogs in /var/logs for the time period where the account was over quota. Does that mean, apache is logging the connections still under /var/log, but it can't write back to the account for awstats due to the account being over quota?
The logs are in /var/log/apache2/logs/domlogs/DOMAIN (there's also a symbolic link to this at /etc/apache2/logs) when statistics are run these are collected by the metrics software and then depending on the configuration placed in the user's homedir - the statistics themselves are updated in /home/$user/tmp/awstats /home/$user/tmp/webalizer etc. If these can't be written too the stats won't update.

2) if we use log rotation for the domlogs or the logs that the metrics come from, does the rotated out data not exist in the metric history? I would assume so, but wanted to check.
Well, the answer to this depends on your settings. If you've selected in Tweak Settings "Archive logs in the user's home directory at the end of each stats run unless configured by the user." and "Remove the previous month's archived logs from the user's home directory at the end of each month unless configured by the user" is off then you will have logs indefinitely. If you've selected on then you will only have the previous month's
 

ca2236

Well-Known Member
Feb 2, 2018
229
22
18
Nebraska
cPanel Access Level
DataCenter Provider
One last question (I hope) :)

Once the quota issue is resolved, is it possible to feed the logs back into the webalizer? I thought I would ask before trying to download a third party metric analyzer.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,273
313
Houston
Hello,

It is possible but it's a bit of a process. Here is how we do it:

extract the old log file copy the run the stats program manually against it, then move the resultant file to the correct flle name for that month:

Code:
cd /home/cPUser/tmp/awstats

cp /home/cPUser/logs/domainname.tld.bkup-Mon-20YY.gz 

gzip -d domainname.tld.bkup-Mon-20YY.gz

/usr/local/cpanel/3rdparty/bin/awstats.pl -config=/home/cPUser/tmp/awstats/awstats.domainname.tld.conf -LogFile=/home/cPUser/tmp/awstats/domainnamed.tld.bkup-Mon-20YY

mv awstatsMM20YY.domainname.tld.txt awstatsMM20YY.domainname.tld.txt.bak

mv awstatsMM20YY.txt awstatsMM20YY.domainnamed.tld.txt

chown cPUser awstatsMM20YY.domainname.tld.txt
Above: replace MON with the Month (Jan, Feb, Mar, etc...), replace cPUser with the cPanel Username, domainname.tld with the domain name, MM with the month (01,02,03, etc...) and 20YY with the year.

Thank you,
 

ca2236

Well-Known Member
Feb 2, 2018
229
22
18
Nebraska
cPanel Access Level
DataCenter Provider
I have a follow up question on the moving directories around.

is it possible to relocate /var/lib/mysqlbackup by changing the path in the configs? (I think its possible by mounting a new partition/disk in that location via fstab) but wanting to actually move the directory path.