mysql 磁盘利用率100_磁盘空间使用率100%的故障处理
磁盤空間使用率100%的故障處理過程
環境介紹:
1.云服務器
2.操作系統 CentOS 5.6
3.內存8G
磁盤與掛載路徑的介紹:
mounted on?????????????????? size
/??????????????????????????? 20G
/usr/local/mysqlslavedb???????? 200G
/usr/local/mysqlslavedb/mysql?? 100G
/dev/shm???????????????????? 2G
事故發生情景:
監控軟件磁盤使用率100%告警,老大 RTX 通知要進行空間釋放解除報警。
分析過程:
1.df -h
[
root@iZ25lJlnb57z local ]# df -h
filesystem?????????? Size???? Used
Avail?? Use%??? Mount on
/dev/xvda1????????? 20G????? 2.2G
17G?? 12%??? /
tmpfs????????????? 1.9G????? 0
1.9G??? 0%??? /dev/shm
/dev/xvdc1????????? 197G??? 197G
0????? 100%?? /usr/local/mysqlslavedb
/dev/xvdb1????????? 99G????? 29G
66G???? 31%??? /usr/local/mysqlslavedb/mysql
/usr/local/mysqlslavedb
注釋:此路徑存放一些MySQL的邏輯備份和計劃任務跑的腳本 庫的輸出 實時查詢的主從狀態文件。
/usr/local/mysqlslavedb/mysql
注釋:這個是存放的MySQL數據庫的相關文件
2.進入到指定目錄下查看文件總共占用空間的大小
[
root@iZ25lJlnb57z mysqlslavedb ]# cd /usr/local/mysqlslavedb
[
root@iZ25lJlnb57z mysqlslavedb ]#pwd
/usr/local/mysqlslavedb
[
root@iZ25lJlnb57z mysqlslavedb ]#du -sh
32G
3.根據以上的1、2分析得出磁盤不是真正的文件占用滿的。
4.產看磁盤是否掉了。
fdisk -l
顯示完整的三塊磁盤 (因為是內網環境,所以沒有辦法貼出結果)
忽然想起來,此服務器是在云服務器上面。
5.尋找云服務器管理人員,查看磁盤狀態。
顯示:磁盤狀態全部正常
6.想到是否刪除的文件沒能釋放磁盤空間
百度查詢了以下資料.
When you open a
file, you get a pointer. ?Subsequent writes to this file
references this file pointer. ?The write call does not check to see if the
file
is there or not. ?It just writes to the specified number of characters
starting
at a predetermined location. ?Regardless of whether the file exist or not,
disk
blocks are used by the write operation.
The df command reports the number of disk blocks used while du goes through
the
file structure and and reports the number of blocks used by each directory.
As
far as du is concerned, the file used by the process does not exist, so it
does
not report blocks used by this phantom file. ?But df keeps track of disk
blocks
used, and it reports the blocks used by this phantom file.
7.更加確定是磁盤空間未能釋放
8.利用lsof命令進行刪除查詢,看那些進程還在運行未能釋放
查看相關路徑下是存在刪除的操作而且沒有釋放
9. ps? -ef查看所有進程
圖表 SEQ圖表\* ARABIC1
因為有一個進程已經KILL掉,所以不能還原全部進程。(還有一個進程是,ftp 上傳到備份機的進程,每次我們要將本機的MySQL邏輯備份打包上傳到我們的備份機,上傳后我們的腳本里要刪除想對應的文件)
此時我懷疑是我們上傳備份的時候,網絡有問題導致了ftp進程一直存在。然后查看近幾天是否有操作。
我詢問運維10月30日是否調整網絡?
運維回答是調整了防火墻。
總結:看圖標1的進程,確實30號還有一個 rar 打包的進程存在,還有一個sh 執行腳本的進程。然后進行 kill 這兩個進程
10. df? -h
再次查看磁盤空間,恢復正常!
11.再次查看刪除進程進程
沒有顯示異常
再次查看進程
ps -ef
所有進程正常!
以上就是此次問題解決過程!
總結
以上是生活随笔為你收集整理的mysql 磁盘利用率100_磁盘空间使用率100%的故障处理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: DDR4内存时序15-15-15-35:
- 下一篇: i7 6700k配多大内存条?内存大小选