서버의 다른 모든 서비스를 중지하고 최신 Ubuntu LTS로 업데이트했지만, 여전히 다음과 같은 오류가 표시됩니다:
PG::ConnectionBad: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: Connection refused (PG::ConnectionBad)
Is the server running locally and accepting connections on that socket?
참조된 게시물에 나와 있듯이, 템플릿을 13번이나 심지어 15번으로 교체해도 문제가 해결되지 않았습니다.
원인:
PG::ConnectionBad: 소켓 "/var/run/postgresql/.s.PGSQL.5432"에 대한 서버 연결 실패: 파일 또는 디렉터리가 없습니다 (PG::ConnectionBad)
서버가 로컬에서 실행 중이며 해당 소켓으로 연결을 수락하고 있습니까?
저 역시 비정상 종료(unclean shutdown) 때문이라고 생각합니다. 백업이 있다면, 새로운 VM을 생성하고 백업을 복원하는 것이 좋습니다. rsync를 사용하여 Discourse 사이트를 다른 VPS로 이동하기 가이드를 따르되, postgres_* 항목은 제외하면 됩니다.
백업이 없는 경우의 대안은, 배우고 싶지 않은 postgres 관련 복잡한 문제들을 직접 해결해야 하는 것입니다.
2025-03-22 00:30:44.110 UTC [4922] FATAL: lock file “postmaster.pid” is empty
2025-03-22 00:30:44.110 UTC [4922] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:45.127 UTC [4964] FATAL: lock file “postmaster.pid” is empty
2025-03-22 00:30:45.127 UTC [4964] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:46.151 UTC [4966] FATAL: lock file “postmaster.pid” is empty
2025-03-22 00:30:46.151 UTC [4966] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:47.168 UTC [4970] FATAL: lock file “postmaster.pid” is empty
2025-03-22 00:30:47.168 UTC [4970] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.
2025-03-22 00:30:48.192 UTC [4977] FATAL: lock file “postmaster.pid” is empty
2025-03-22 00:30:48.192 UTC [4977] HINT: Either another server is starting, or the lock file is the remnant of a previous server startup crash.