아래의 오류 메시지가 지속적으로 발생하고 있습니다… discourse doctor를 실행해 보았지만 해결되지 않았습니다. 무엇이 문제인지 방향을 잡아 주실 수 있는 분이 계신지 궁금합니다. 미리 감사드립니다! -Tim
[2021-06-11T04:09:29.733935 #1] INFO -- : > HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main
I, [2021-06-11T04:09:29.735773 #1] INFO -- : > sleep 5
2021-06-11 04:09:30.320 GMT [54] LOG: 0 8kB is outside the valid range for parameter "shared_buffers" (16 .. 1073741823)
2021-06-11 04:09:30.322 UTC [54] FATAL: configuration file "/etc/postgresql/13/main/postgresql.conf" contains errors
I, [2021-06-11T04:09:34.739847 #1] INFO -- :
I, [2021-06-11T04:09:34.740097 #1] INFO -- : > su postgres -c 'createdb discourse' || true
createdb: error: could not connect to database template1: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-06-11T04:09:34.860266 #1] INFO -- :
I, [2021-06-11T04:09:34.860745 #1] INFO -- : > su postgres -c 'psql discourse -c "create user discourse;"' || true
psql: error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-06-11T04:09:35.023423 #1] INFO -- :
I, [2021-06-11T04:09:35.023810 #1] INFO -- : > su postgres -c 'psql discourse -c "grant all privileges on database discourse to discourse;"' || true
psql: error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-06-11T04:09:35.137806 #1] INFO -- :
I, [2021-06-11T04:09:35.138325 #1] INFO -- : > su postgres -c 'psql discourse -c "alter schema public owner to discourse;"'
psql: error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
I, [2021-06-11T04:09:35.257190 #1] INFO -- :
I, [2021-06-11T04:09:35.257476 #1] INFO -- : Terminating async processes
FAILED
--------------------
Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return #<Process::Status: pid 80 exit 2>
Location of failure: /pups/lib/pups/exec_command.rb:112:in `spawn'
exec failed with the params "su postgres -c 'psql $db_name -c \"alter schema public owner to $db_user;\"'"
14ef6216494c846091ea6ce48143e2f25018b9d2579b6d4d0021d605f7f5e145
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
지난 6월에 Oracle Free에서 Discourse를 설정하는 데 성공했습니다. 그런데 방금 이메일 설정과 관련된 몇 가지 파라미터를 변경하려고 설정 스크립트를 다시 실행했는데 문제가 생겼습니다.
로그에서 추적할 수 있는 첫 번째 오류는 FATAL: configuration file "/etc/postgresql/13/main/postgresql.conf" contains errors인데, 제 경우 해당 파일이 존재하지 않습니다. 또한 postgresql 서비스가 실행되지 않고 있습니다(서비스로조차 사용 불가능한 상태입니다).
제안해 주셔서 감사합니다. 더 많은 정보를 수집했습니다.
아래는 오류가 발생한 시점前后的 로그입니다 (이전 메시지들은 며칠 전 것입니다):
2021-08-02 13:33:16.980 UTC [2419] LOG: received smart shutdown request
2021-08-02 13:33:28.273 UTC [2419] LOG: background worker "logical replication launcher" (PID 2442) exited with exit code 1
2021-08-02 13:33:28.344 UTC [2437] LOG: shutting down
2021-08-02 13:33:28.552 UTC [2419] LOG: database system is shut down
또한 공유 버퍼 설정도 확인했습니다:
shared_buffers = 128MB # min 128kB
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
일부 구성 파라미터를 변경하기 위해 기존 설치 환경에서 설정을 실행하고 있습니다. 스크립트의 첫 번째 부분이 다음 내용을 감지했습니다:
sudo ./discourse-setup
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin)
which: no docker.io in (/sbin:/bin:/usr/sbin:/usr/bin)
The configuration file containers/app.yml already exists!
. . . reconfiguring . . .
Saving old file as app.yml.2021-08-03-102829.bak
Stopping existing container in 5 seconds or Control-C to cancel.
+ /bin/docker stop -t 30 app
app
Found 0GB of memory and 1 physical CPU cores
setting db_shared_buffers = 0MB
setting UNICORN_WORKERS = 0
containers/app.yml memory parameters updated.
이어서 모든 구성 파라미터를 전달하고 마침내 빌드하는 과정으로 이어집니다… 이것이 여러분이 찾고 있는 단서가 될 것입니다.
2021-08-03 10:30:37.709 GMT [55] LOG: 0 8kB is outside the valid range for parameter "shared_buffers" (16 .. 1073741823)
2021-08-03 10:30:37.713 UTC [55] FATAL: configuration file "/etc/postgresql/13/main/postgresql.conf" contains errors
해결되셨다니 다행입니다. 링크된 스레드와 여기서 언급된 해당 스레드를 살펴보니, ‘마법 같은 관대함(magic forgiveness)’ 값인 990을 자기 시스템에 맞는 숫자로 바꾸는 것이 훨씬 낫다고 생각합니다. '메모리 체크 비활성화’는 오히려 문제를 일으키고 있거든요.
제 생각에는 Discourse 팀이 지원되는 구성과 지원되지 않는 구성 사이에 선을 긋기 위해 어떤 값의 하한선을 설정해야 하는데, 이를 공식적으로 1G로 정하고 990으로 완화한 것 같습니다. 하지만 960은 990에 꽤 가깝고, 비슷한 이유로 발생하는 값이라 생각합니다. 반면 703은 꽤 큰 차이가 있죠!
에드, 안녕하세요.
숫자를 변경하는 데 동의합니다. 메모리가 이렇게 낮은 것에 대해 꽤 놀랐습니다. Oracle(무료 플랜) 인스턴스 사양에는 1GB의 메모리가 표시되는데, 실제 무료 환경에서는 약 60~70% 정도만 사용 가능한 것 같습니다. 이유를 모르겠어서 조금 혼란스럽습니다.
아마도 가장 중요한 누락된 지침은 기본 서버 이미지를 사용하지 말 것입니다. Discourse는 1GB의 RAM(또는 그 정도)가 필요하지만, Oracle Linux 이미지는 왜 그런지 모르게 충분한 메모리를 남기지 않습니다. CentOS가 작동할지는 모르겠지만, Ubuntu 이미지는 문제없습니다. “Minimal” 설치 대신 전체 설치2를 선택하는 것을 꼭 확인하세요.
기본 Oracle Linux에는 Discourse 설치에 필요하지 않은 여러 가지가 포함되어 있을 것 같습니다. 아마도 주요 사용 사례가 Oracle 데이터베이스 서버 호스팅일 테니까요. 다행히도 Ubuntu 이미지는 잘 작동합니다. 제 테스트 사이트/댓글 호스트도 여전히 실행 중입니다. (다만, 활동은 많지 않습니다.)