![Redis에서 열린 파일의 최대 수를 늘릴 수 없습니다.](https://linux55.com/image/134139/Redis%EC%97%90%EC%84%9C%20%EC%97%B4%EB%A6%B0%20%ED%8C%8C%EC%9D%BC%EC%9D%98%20%EC%B5%9C%EB%8C%80%20%EC%88%98%EB%A5%BC%20%EB%8A%98%EB%A6%B4%20%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
나는 ubunto 18.04를 사용하고 있는데 redis-server
터미널에서 실행하면 다음과 같이 나타납니다.
# oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
# Redis version=4.0.9, bits=64, commit=00000000, modified=0, pid=11260, just started
# Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
# You requested maxclients of 10000 requiring at least 10032 max file descriptors.
# Server can't set maximum open files to 10032 because of OS error: Operation not permitted.
# Current maximum open files is 1022. maxclients has been reduced to 990 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.
# Creating Server TCP listening socket *:6379: bind: Address already in use
이전에 다음을 실행하여 이 제한을 늘리려고 했습니다.
ulimit -n 10240
그러나 다음과 같은 오류가 발생했습니다.
bash: ulimit: open files: cannot modify limit: Operation not permitted
그런 다음 실행하여 값을 낮추려고했는데 ulimit -n 1022
놀랍게도 성공적으로 실행되어 한도가 낮아졌습니다.
그럼 나도 따라갈게이 답변, 그러나 echo 800000 > /proc/sys/fs/file-max
"file-max" 파일을 덮어쓴 후 실제로 최대 파일 제한을 변경하지는 않았습니다.
$ ulimit -n
1022
여기다른 관련 질문을 찾았는데 제 경우는 다음과 같습니다.시스템 C하나. 나는 다음을 시도합니다.
/etc/security/limits.conf
1) 파일에 다음 줄을 추가했습니다.
* soft nofile 4096
* hard nofile 10240
/etc/ssh/sshd_config
2) 파일에 다음 줄을 추가합니다.
UsePAM=yes
3) "/etc/pam.d/sshd" 파일에 다음 내용을 추가합니다.
session required pam_limits.so
그러나 여전히 효과가 없습니다. ulimit -n
명령에 여전히 1022가 표시됩니다.