ERR Can't save in background: fork failed: Background save failed: fork failed(バックグラウンド保存失敗: fork 失敗)
Redis意味
Redis がバックグラウンドの RDB スナップショットまたは AOF 書換えのための子プロセスを作成 (fork) できなかった。永続化が実行できないため、データをディスクに書き込めない。
原因
OS が fork に十分なメモリを割り当てられない。通常は overcommit_memory が無効で、Redis が使用中のメモリのほぼコピー分を確保しようとするとシステムが拒否する。物理/仮想メモリの不足やプロセス数の上限も原因となる。
対処方法
Linux でメモリのオーバーコミットを有効にする: sysctl vm.overcommit_memory=1 (恒久化するには /etc/sysctl.conf に追加する)。サーバーにメモリを追加するか、Redis のメモリ使用量を下げる (maxmemory)。十分なスワップ領域を用意する。プロセス/ファイルディスクリプタの上限を確認する (ulimit)。永続化が重要な場合、これらの設定なしで本番運用しない。
同じデータベースの他の項目
- ERR unknown subcommandERR unknown subcommand or wrong number of arguments(不明なサブコマンドまたは引数の数の誤り)
- ERR Client sent AUTH, but no password is setERR AUTH <password> called without any password configured for the default user (Redis 6+) / ERR Client sent AUTH, but no password is set (Redis <6)(パスワード未設定のサーバーへの AUTH)
- ERR DEBUG command not allowedDEBUG command not allowed(DEBUG コマンドは許可されていない)
- NOPROTO unsupported protocol versionUnsupported RESP protocol version(サポートされない RESP プロトコルバージョン)
- ERR Unknown option or number of arguments for CONFIG SETUnknown option or number of arguments for CONFIG SET (older versions: Unsupported CONFIG parameter)(CONFIG SET の不明なオプションまたは引数の数)
- ERR MULTI calls can not be nestedMULTI calls can not be nested(MULTI はネストできない)
- ERR Lua script attempted to access nonexistent global variableLua script attempted to access a nonexistent global variable(Lua スクリプトが存在しないグローバル変数にアクセスしようとした)