MySQL 데몬 시작시 멈추어 있는 현상

Jmnote bot (토론 | 기여)님의 2020년 11월 2일 (월) 00:41 판 (봇: 자동으로 텍스트 교체 (-<source +<syntaxhighlight ))
MySQL 데몬 시작시 멈추어 있는 현상
MySQL 데몬 시작시 멈춰 있는 현상
mysqld 시작시 멈추는 현상

1 문제상황

아파치 데몬은 잘 시작되는데, MySQL 데몬이 시작되지 않았다. <syntaxhighlight lang='console'> [root@zetawiki ~]# service httpd start Starting httpd: [ OK ] [root@zetawiki ~]# service mysqld start MySQL Daemon failed to start. Starting MySQL: [FAILED] </source>

잠시 후 다시 시도해보니 아무리 기다려도 응답이 없다. (흔히 hang 걸림 또는 stuck이라고 표현하는 그 현상) <syntaxhighlight lang='console'> [root@zetawiki ~]# service mysqld start </source>

2 확인

일단 로그를 확인. <syntaxhighlight lang='console'> [root@jmote ~]# tail /var/log/mysqld.log 120205 00:29:38 mysqld_safe mysqld restarted 120205 0:29:38 [Note] Plugin 'ndbcluster' is disabled. 120205 0:29:38 InnoDB: Started; log sequence number 0 44243 120205 0:29:38 [ERROR] /usr/libexec/mysqld: Error writing file '/var/run/mysqld/mysqld.pid' (Errcode: 28) 120205 0:29:38 [ERROR] Can't start server: can't create PID file: No space left on device 120205 00:29:39 mysqld_safe Number of processes running now: 0 120205 00:29:39 mysqld_safe mysqld restarted 120205 0:29:39 [Note] Plugin 'ndbcluster' is disabled. 120205 0:29:39 InnoDB: Started; log sequence number 0 44243 120205 0:29:39 [ERROR] /usr/libexec/mysqld: Error wri[root@jmote ~]# </source> 로그 파일이 써지다가 말았다니 뭔가 이상하다. 디스크 꽉참(disk full)이 의심되는 상황

3 해결

<syntaxhighlight lang='console'> [root@jmote ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup-lv_root

                     18819820  18819820         0 100% /

/dev/xvda1 198337 23227 164870 13% /boot tmpfs 266592 0 266592 0% /dev/shm </source> 역시 그렇다..

/home에 백업 파일을 주기적으로 생성하도록 해놓고 지우지 않았던 것이 문제. <syntaxhighlight lang='console'> [root@zetawiki ~]# du -hs /* 7.9M /bin 18M /boot 136K /dev 93M /etc 9.9G /home 173M /lib 23M /lib64 20K /lost+found 4.0K /media 4.0K /mnt 4.0K /opt </source> 지난달 백업 파일을 모두 삭제하였다. 그랬더니 정상화되었다. <syntaxhighlight lang='console'> [root@zetawiki ~]# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup-lv_root

                     18819820   9071964   8791852  51% /

/dev/xvda1 198337 23227 164870 13% /boot tmpfs 266592 0 266592 0% /dev/shm [root@zetawiki ~]# service mysqld start Starting MySQL: [ OK ] </source>

4 의견

  • 백업 스크립트를 돌릴 때는 보존기간이 지난 백업파일을 지우는 명령어도 포함시키자.

5 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}