SQL Error: Disk Full

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: SQL Error: Disk Full

Post by avandemore »

Your VG size is at approximately 16GB with basically 100% used. Did you reboot before you attempted the pvresize? That was already asked but not answered. It's important to do that so LVM can retaste the block devices.

Again as already noted LVM needs disk space to perform this resize operation. The most recent df -h listed shows: /dev/mapper/centos-root 14G 14G 20K 100% /
Previous Nagios employee
SteveBeauchemin
Posts: 524
Joined: Mon Oct 14, 2013 7:19 pm

Re: SQL Error: Disk Full

Post by SteveBeauchemin »

Just to be clear relative to my previous post. When other folks read this at a later date, so they understand about the tmpdir suggestion.

MySQL default location for tmpdir is /var/tmp - as shown in the first post of this sequence.
Disk full (/var/tmp/#sql_5037_0)
This is a preventative suggestion for the future. You do not want your MySQL tmp location to become full. It may cause loss of sleep.

From the /etc/my.cnf file I have setup the [mysqld] section

Code: Select all

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
tmpdir=/usr/local/mysqltmp  # Add this <<--- to a much larger Volume
... plus other stuff...
I believe that you added it to a different section in the my.cnf file.

It will simply relocate where sql puts temporary files. It is not going to fix your bad files. It will not un-corrupt for you. It just lets you put the MySQL temp files in a volume that has more space than /var/tmp. My /var/tmp volume is very small. It caused me much grief until I figured out what was happening. The steps I took were to make a new directory, stop Nagios completely, including MySQL, ndo2db, and anything else. I changed the my.cnf file by adding the tmpdir aimed at the new location, on a much larger volume. I made sure that the new directory permissions were set properly for the MySQL to have full rights there. Then I restarted everything. From that point forward my temporary files have plenty of room.

So, you may also want to move the MySQL temporary file location. That is something to help prevent a future space issue.

Thanks

Steve B
XI 5.7.3 / Core 4.4.6 / NagVis 1.9.8 / LiveStatus 1.5.0p11 / RRDCached 1.7.0 / Redis 3.2.8 /
SNMPTT / Gearman 0.33-7 / Mod_Gearman 3.0.7 / NLS 2.0.8 / NNA 2.3.1 /
NSClient 0.5.0 / NRPE Solaris 3.2.1 Linux 3.2.1 HPUX 3.2.1
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SQL Error: Disk Full

Post by tgriep »

venturegardengroup, did you reboot the server?
Can you post the full output of this command?

Code: Select all

fdisk -l
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: SQL Error: Disk Full

Post by venturegardengroup »

Any suggestions please?

Regards,
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: SQL Error: Disk Full

Post by venturegardengroup »

Sorry, missed the post. Please see below:

[root@localhost ~]# fdisk -l

Disk /dev/sda: 26.8 GB, 26843545600 bytes, 52428800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x00005d36

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 52428799 25701376 8e Linux LVM

Disk /dev/mapper/centos-root: 14.9 GB, 14889779200 bytes, 29081600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/centos-swap: 1719 MB, 1719664640 bytes, 3358720 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@localhost ~]#


Regards.
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: SQL Error: Disk Full

Post by venturegardengroup »

Yes I rebooted both the CentOs and the VM.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SQL Error: Disk Full

Post by tgriep »

Thanks for the info.
I am thinking the issue is that pvresize needs a little free space on the drive to run and yours has nothing left and that is causing the error.
Try removing a few of the old logfiles in the /var/log folder and is you have any old Nagios XI backups, they can be removed as well.
Look in the following folder for the XI backups

Code: Select all

/store/backups/nagiosxi
You can also use the following to find out what is using the space on the server.
Find top 20 largest directories by size:

Code: Select all

du -a / | sort -n -r | head -n 20
Find largest 10 directories by size command:

Code: Select all

find / -type d -print0 | xargs -0 du | sort -n | tail -10 | cut -f2 | xargs -I{} du -sh {}
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: SQL Error: Disk Full

Post by venturegardengroup »

I have been able to free up some space on the nagios backup folder and also ran a database repair command. Seems there is an issue with the mariadb.

Please see output attached.

Regards,
You do not have the required permissions to view the files attached to this post.
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: SQL Error: Disk Full

Post by tgriep »

Can you run the following as root on the XI server

Code: Select all

systemctl restart mariadb.service
Then run the following commands and post the output here so we can view the error?

Code: Select all

tail -20 /var/log/mariadb/mariadb.log
tail -20 /var/log/messages
Be sure to check out our Knowledgebase for helpful articles and solutions!
venturegardengroup
Posts: 62
Joined: Tue Jun 28, 2016 10:11 am

Re: SQL Error: Disk Full

Post by venturegardengroup »

Hello,

Please see output attached.

Kind regards,
You do not have the required permissions to view the files attached to this post.
Locked