[Redis] Failed opening .rdb for saving: Read-only file system
Background saving error
You requested maxclients of 10000 requiring at least 10032 max file descriptors.
Redis can't set maximum open files to 10032 because of OS error: Operation not permitted.
Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
1436:M 25 Mar 06:50:59.353 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1436:M 25 Mar 06:50:59.353 # Server started, Redis version 3.0.6
1436:M 25 Mar 06:50:59.353 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
vm.overcommit_memory = overcommit에 대한 enable/disable을 결정하는 중요한 파라미터
0 = 커널에서 설정하는 기본값 어림잡아서 overcommit을 허용하는 옵션임 free 메모리를 가지고 계산하지 않으며
Page Cashe + Swap Memory + Slab Reclaimable을 함친 수가 요청한 메모리 수보다 클경우 commit 일어남
1 = 항상 overcommit을 함
2 = 제한적 overcommit을 허용함 지정된 영역(Swap 영역의 크기 + vm.overcommit_ratio 값)을 넘어가면 commit 실패함
메모리 commit 최댓값 확인 (옵션 2일 경우만 가능 )
cat /proc/meminfo
1436:M 25 Mar 06:50:59.353 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1436:M 25 Mar 06:50:59.473 * DB loaded from disk: 0.121 seconds
1436:M 25 Mar 06:50:59.473 * The server is now ready to accept connections on port 6379
1436:M 25 Mar 07:23:32.458 * 1 changes in 900 seconds. Saving...
1436:M 25 Mar 07:23:32.458 * Background saving started by pid 60607
60607:C 25 Mar 07:23:32.546 * DB saved on disk
60607:C 25 Mar 07:23:32.546 * RDB: 0 MB of memory used by copy-on-write
1436:M 25 Mar 07:23:32.561 * Background saving terminated with success
1436:M 25 Mar 07:28:33.078 * 10 changes in 300 seconds. Saving...
1436:M 25 Mar 07:28:33.079 * Background saving started by pid 68586
68586:C 25 Mar 07:28:33.107 * DB saved on disk
68586:C 25 Mar 07:28:33.107 * RDB: 0 MB of memory used by copy-on-write
1436:M 25 Mar 07:28:33.179 * Background saving terminated with success
해결방법
1. ulimit -n <변경할 용량> 용량을 변경
2. redis가 설치된 경로로 가서 vim 또는 gedit
redis.conf 파일을 열고 stop-writes-on-bgsave-error yes를
redis.conf 파일을 열고 stop-writes-on-bgsave-error no로 변경
3. 혹은 짧은 시간에 계속 RDB가 생성 되어 DISK IO가 많이 발생한다면
redis.conf 파일을 열고 SAVE값을 제거 (config set SAVE "")
참고 사이트 아래주소
'Solve to troubleshoot' 카테고리의 다른 글
count(): Parameter must be an array or an object that implements Countable (0) | 2020.05.18 |
---|---|
phpmyadmin 초기 설치시 에러 (0) | 2020.03.31 |
if (e.name === 'BrowserslistError') throw e (0) | 2020.02.25 |
드라이버 : STATUS_ACCESS_DENIED 에러 (0) | 2019.11.06 |
드라이버 : signability test failed (0) | 2019.11.06 |