Discourse를 업그레이드한 이후로 이상한 문제가 발생하고 있습니다.
cd /var/discourse
./launcher enter app
cd /shared/log/rails
tail -f production.log
명령을 실행하면 다음과 같은 메시지가 무한히 출력됩니다:
Job exception: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
Error connecting to Redis on localhost:6379 (Redis::TimeoutError)
unicorn.stderr.log에는 다음과 같은 내용이 가득 차 있습니다:
E, [2022-03-01T20:45:20.703541 #65] ERROR -- : reaped #<Process::Status: pid 30842 exit 1> worker=unknown
Detected dead worker 30842, restarting...
Failed to report error: Error connecting to Redis on localhost:6379 (Redis::TimeoutError) 3 Job exception: Error connecting to Redis on localhost:6379 (Redis::TimeoutError)
MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/redis-4.1.3/lib/redis/client.rb:126:in `call'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/redis-4.1.3/lib/redis.rb:538:in `block in del'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/redis-4.1.3/lib/redis.rb:52:in `block in synchronize'
...
분명 Redis 관련 문제인 것 같고, 어떤 방식으로든 강제 종료되고 있다고 의심했지만, docker 이미지 외부의 커널 로그에서는 그런 징후가 보이지 않습니다. 그러나 docker 이미지 내부에서는 다음과 같은 것을 확인할 수 있습니다:
$ df -h
Filesystem Size Used Avail Use% Mounted on
overlay 157G 53G 97G 36% /
tmpfs 64M 0 64M 0% /dev
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
shm 512M 0 512M 0% /dev/shm
/dev/sda 157G 53G 97G 36% /shared
tmpfs 3.9G 0 3.9G 0% /proc/acpi
tmpfs 3.9G 0 3.9G 0% /proc/scsi
tmpfs 3.9G 0 3.9G 0% /sys/firmware
$ free
total used free shared buff/cache available
Mem: 8167420 3248628 794816 8596 4123976 4634504
Swap: 524284 268 524016
매우 나쁘지는 않지만, 이상적인 상태도 아닌 것 같습니다.
호스트 시스템에서 htop을 실행하면 다음과 같은 결과가 나옵니다:
이 문제를 디버깅하고 해결하기 위한 단계에 대해 어떤 의견이 있으신가요?
