Page 1 of 4

SQL Error: Disk Full

Posted: Mon Oct 10, 2016 8:48 am
by venturegardengroup
Hello,

I got this error when I logged into my Nagios Server: SQL: SQL Error [nagiosxi] : Disk full (/var/tmp/#sql_5037_0); waiting for someone to free some space... SQL: SQL Error [nagiosxi] : Table 'xi_incidents' already exists.

How can I resolve this issue?

Regards,

Re: SQL Error: Disk Full

Posted: Mon Oct 10, 2016 9:55 am
by rkennedy
What is the output of df -h?

Without confirming though, it looks like your machine is out of disk space, you'll want add more space to it. See this document - https://assets.nagios.com/downloads/nag ... M-Disk.pdf

Re: SQL Error: Disk Full

Posted: Wed Oct 12, 2016 9:55 am
by venturegardengroup
I have successfully resized the virtual disk and the partition. However, when trying to resize the PV I get the following error:

[root@localhost ~]# pvresize /dev/sda2
/etc/lvm/archive/.lvm_localhost.localdomain_2235_1923109799: write error failed: No space left on device
Volume group "centos" metadata archive failed.
0 physical volume(s) resized / 1 physical volume(s) not resized


How do I proceed?

Regards,

Re: SQL Error: Disk Full

Posted: Wed Oct 12, 2016 11:26 am
by tgriep
After resizing the partition using the fdisk command, you need to reboot the server, did you do that?
If not, that could be the issue you are having.
If after you reboot, you still have errors, run the following and post the output.

Code: Select all

df -h
fdisk -l
vgdisplay

Re: SQL Error: Disk Full

Posted: Wed Oct 12, 2016 12:26 pm
by SteveBeauchemin
I have had this before too...

On my system, I edited /etc/my.cnf and added

Code: Select all

tmpdir=/usr/local/mysqltmp
We have /usr/local on our system mounted as a separate volume. With lots of space.

Steve B

Re: SQL Error: Disk Full

Posted: Wed Oct 12, 2016 2:56 pm
by ssax
Make sure that you clean up some additional space first before doing it again (it needs space to perform the operation) but SteveBeauchemin is correct about the myql tmpdir as well if you're running into that issue as well.

Thank you

Re: SQL Error: Disk Full

Posted: Thu Oct 13, 2016 3:28 am
by venturegardengroup
Hi tgriep,

See output below:

[root@localhost ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 14G 14G 20K 100% /
devtmpfs 909M 0 909M 0% /dev
tmpfs 919M 0 919M 0% /dev/shm
tmpfs 919M 27M 893M 3% /run
tmpfs 919M 0 919M 0% /sys/fs/cgroup
/dev/sda1 497M 123M 375M 25% /boot
tmpfs 184M 0 184M 0% /run/user/1001
tmpfs 184M 0 184M 0% /run/user/0
[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 ~]# vgdisplay
--- Volume group ---
VG Name centos
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size 15.51 GiB
PE Size 4.00 MiB
Total PE 3970
Alloc PE / Size 3960 / 15.47 GiB
Free PE / Size 10 / 40.00 MiB
VG UUID sX2X40-A6WE-d28e-pC9J-AMf3-ZZ0F-8zReRc

Re: SQL Error: Disk Full

Posted: Thu Oct 13, 2016 3:39 am
by venturegardengroup
Hello SteveBeauchemin,

I tried your suggestion as well, see output below:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid
tmpdir=/usr/local/mysqltmp
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


[root@localhost ~]# pvresize /dev/sda2
Couldn't create temporary archive name.
Volume group "centos" metadata archive failed.
0 physical volume(s) resized / 1 physical volume(s) not resized

Regards,

Re: SQL Error: Disk Full

Posted: Thu Oct 13, 2016 9:23 am
by tgriep
Go through the manual again, especially the Resizing the Partition section. It looks like that didn't take hold and needs to be run again.
https://assets.nagios.com/downloads/nag ... M-Disk.pdf

Re: SQL Error: Disk Full

Posted: Thu Oct 13, 2016 10:47 am
by venturegardengroup
I think it did take place cause before I resized the partition the block size for the Linux LVM (/dev/sda) was about 16GB but after resizing it now reflects about 25GB. See output below

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

I just did it again, but still having the same issue.

Regards,