Score:0

After running a long running task on mysql node.js my var/lib/mysql folder has become full

in flag

I was trying to run a long running task that update a database and database size is around 2GB and total server disk size is 25GB.

So now we are seeing that server is full. When run df -h in /var/lib/mysql# here is the result I get:

Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           394M   41M  354M  11% /run
/dev/vda1        25G   25G     0 100% /
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/vda15      105M  9.2M   96M   9% /boot/efi
/dev/loop0       33M   33M     0 100% /snap/snapd/12704
/dev/loop3       56M   56M     0 100% /snap/core18/2128
/dev/loop1       68M   68M     0 100% /snap/lxd/20326
/dev/loop4       71M   71M     0 100% /snap/lxd/21029
/dev/loop2       56M   56M     0 100% /snap/core18/2074
/dev/loop5       33M   33M     0 100% /snap/snapd/12883
tmpfs           394M     0  394M   0% /run/user/0

Here I can see /dev/vda1 25G 25G 0 100% is full!

If I do ls in the mysql directory, I see lots of files along with my database example_database

    '#ib_16384_0.dblwr'   binlog.000207   binlog.000221   binlog.000235   binlog.000249   binlog.000263   binlog.000277   binlog.000291   binlog.000305   binlog.000319   binlog.000333   binlog.000347   binlog.000361     client-key.pem       pwa-ubuntu-c-2-4gib-sfo2-01.pid
'#ib_16384_1.dblwr'   binlog.000208   binlog.000222   binlog.000236   binlog.000250   binlog.000264   binlog.000278   binlog.000292   binlog.000306   binlog.000320   binlog.000334   binlog.000348   binlog.000362     debian-5.7.flag      server-cert.pem
'#innodb_temp'        binlog.000209   binlog.000223   binlog.000237   binlog.000251   binlog.000265   binlog.000279   binlog.000293   binlog.000307   binlog.000321   binlog.000335   binlog.000349   binlog.000363     example_database     server-key.pem
auto.cnf             binlog.000210   binlog.000224   binlog.000238   binlog.000252   binlog.000266   binlog.000280   binlog.000294   binlog.000308   binlog.000322   binlog.000336   binlog.000350   binlog.000364     ib_buffer_pool       sys
binlog.000197        binlog.000211   binlog.000225   binlog.000239   binlog.000253   binlog.000267   binlog.000281   binlog.000295   binlog.000309   binlog.000323   binlog.000337   binlog.000351   binlog.000365     ib_logfile0          undo_001
binlog.000198        binlog.000212   binlog.000226   binlog.000240   binlog.000254   binlog.000268   binlog.000282   binlog.000296   binlog.000310   binlog.000324   binlog.000338   binlog.000352   binlog.000366     ib_logfile1          undo_002
binlog.000199        binlog.000213   binlog.000227   binlog.000241   binlog.000255   binlog.000269   binlog.000283   binlog.000297   binlog.000311   binlog.000325   binlog.000339   binlog.000353   binlog.000367     ibdata1              youhome
binlog.000200        binlog.000214   binlog.000228   binlog.000242   binlog.000256   binlog.000270   binlog.000284   binlog.000298   binlog.000312   binlog.000326   binlog.000340   binlog.000354   binlog.000368     mysql
binlog.000201        binlog.000215   binlog.000229   binlog.000243   binlog.000257   binlog.000271   binlog.000285   binlog.000299   binlog.000313   binlog.000327   binlog.000341   binlog.000355   binlog.000369     mysql.ibd
binlog.000202        binlog.000216   binlog.000230   binlog.000244   binlog.000258   binlog.000272   binlog.000286   binlog.000300   binlog.000314   binlog.000328   binlog.000342   binlog.000356   binlog.000370     mysql_upgrade_info
binlog.000203        binlog.000217   binlog.000231   binlog.000245   binlog.000259   binlog.000273   binlog.000287   binlog.000301   binlog.000315   binlog.000329   binlog.000343   binlog.000357   binlog.index      performance_schema
binlog.000204        binlog.000218   binlog.000232   binlog.000246   binlog.000260   binlog.000274   binlog.000288   binlog.000302   binlog.000316   binlog.000330   binlog.000344   binlog.000358   ca-key.pem        phpmyadmin
binlog.000205        binlog.000219   binlog.000233   binlog.000247   binlog.000261   binlog.000275   binlog.000289   binlog.000303   binlog.000317   binlog.000331   binlog.000345   binlog.000359   ca.pem            private_key.pem
binlog.000206        binlog.000220   binlog.000234   binlog.000248   binlog.000262   binlog.000276   binlog.000290   binlog.000304   binlog.000318   binlog.000332   binlog.000346   binlog.000360   client-cert.pem   public_key.pem

No sure what all these files though..

Help please!

Soren A avatar
mx flag
If you are sure that /var/lib/mysql is full, list the cotent or use `du` to see what fiile(s) take up the space.Also check sub-directories. `df` doesn't help here, it just shows usage of mount-points - and, yes, / is 100% full.
Hkm Sadek avatar
in flag
when I use du I get this `84 ./sys 724 ./#innodb_temp 36 ./mysql 4 ./youhome 1716 ./phpmyadmin 1588 ./performance_schema 1565520 ./example_database 17301484 . `
Hkm Sadek avatar
in flag
so du says `17301484 .` here not sure what . means. this dot is using 17gb+
David avatar
cn flag
BTW it is recommend you have 25 gig for the OS so I would say you Ubuntu space is too small as well.
Score:0
in flag

Ok my problem was, mysql was generating binalog file, so I deleted log file using PURGE BINARY LOGS BEFORE DATE(NOW() - INTERVAL 10 DAY) + INTERVAL 0 SECOND;

Thanks

Soren A avatar
mx flag
Please accept your own answer.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.