서버
linux 리눅스 tail: inotify cannot be used, reverting to polling: Too many open files 해결 방법
Yondata
2023. 8. 18. 10:30
728x90
반응형
watches 설정 수정
[root@yon ~]# sysctl fs.inotify.max_user_watches
1024
[root@yon ~]# vi /etc/sysctl.conf
fs.inotify.max_user_watches = 1048576
[root@yon ~]# sysctl -p
fs.inotify.max_user_watches = 1048576
[root@yon ~]# sysctl fs.inotify.max_user_watches
1048576
losf 처리
[lsof] 는 List Open Files 의 약자로 시스템에서 열려있는 파일에 대한 정보를 출력해주는 명령어
[root@yon]# lsof -c tail |grep log
tail 419 tomcat_was 3r REG 253,2 595553 134363266 /home/tomcat_was/yonm/logs/nohup/yonm.out.2023-07-22
tail 538 tomcat_was 3r REG 253,2 680947 134627090 /home/tomcat_was/yonm/logs/nohup/yonm.out.2023-06-12
tail 733 tomcat_was 3r REG 253,2 680947 134627071 /home/tomcat_was/yonm/logs/nohup/yonm.out.2023-06-09
tail 800 tomcat_was 3r REG 253,2 164741 138330068 /home/tomcat_was/yonm/logs/nohup/yonm.out.2023-08-03
[root@yon]# kill -9 419
#PID 추출
[root@yon]# lsof -c tail |grep log | awk '{print $2}'
#추출한 PID 리스트 kill
[root@yon]#kill -9 $(lsof -c tail |grep log | awk '{print $2}')
관련 프로세스 pid로 kill 하거나 관련 로그파일 삭제하면 됨
728x90
반응형