CentOS 7.6에서 too many files open 에러 발생 현상시 조치방안
[환경]
CentOS 7.6, mariadb 10.2.23
[증상]
[ERROR] Error in accept: Too many open files 에러 문구가 출력되면서 PC Agent 접속이 안되거나 DBSAFER DB 접속이 안되는 증상
[원인]
DB에서 Open File limit 수를 초과하여 파일을 열었을 경우 발생
[조치방안]
1. OS 계정별로 열수 있는 파일 개수 확인 및 수정 > DBSAFER 5.0 설치시 하기 사진과 같이 기본적으로 설정되어 있음
vi /etc/security/limits.conf
2. 설정값 확인
ulimit -a
ulimit -n
> DBSAFER RPM 설치시 65534값으로 설정된 것 확인됨
3. maria DB 접속후 open file limits 개수 확인
show variables like 'open_files_limit';
ps -ef |grep mysql (PID 체크 후) -> losf -p [PID] |frep wc -l로 현재 mysql이 열고 있는 파일 개수 확인
4. open_files_limit 설정 방법
vi /etc/,y.cnf
> max_connections 하기에 open_files_limit=64000 추가 ** 권장값은 30000입니다. **
5. DB 재시작
systemctl restart mysql
6. 프로세스 시간 체크
ps -ef |grep mysql
7. DB 접속 후 값 변경된거 확인
show variables like 'file_open_limit';
내용참고
https://kugancity.tistory.com/entry/mysql-maxopenfile-%EC%82%AC%EC%9D%B4%EC%A6%88-%EC%A6%9D%EA%B0%80%ED%95%98%EA%B8%B0