별도의 Redis 설정 시 오류 발생

로컬 네트워크 안에서 PostgreSQL이 실행 중인 다소 게으른 데이터베이스 서버가 하나 있습니다. 이 서버를 Discourse에도 사용하려고 했습니다. 그 이유는 웹 서버가 앞서 언급한 데이터베이스 서버보다 훨씬 더 부하가 높고, 데이터베이스 서버에는 아직 많은 미사용 리소스/여력이 있기 때문입니다. Discourse의 PostgreSQL을 재지정하는 것은 이 포럼의 몇 가지 스레드(예시)를 따라가면 꽤 쉬웠습니다. 하지만 Redis에 대해 동일한 작업을 시도할 때는 다음과 같은 문제를 겪고 있습니다:

  • - "templates/redis.template.yml" 주석 처리
  • DISCOURSE_REDIS_HOST 설정

이렇게 하면 항상 다음과 같은 오류가 발생합니다:

Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 582 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1

launcher rebuild app을 실행하여 재빌드하려고 할 때마다 항상 이 오류가 나옵니다.

이것은 알려진 문제인가요? 컨테이너화되지 않은 Redis를 사용하여 Discourse를 성공적으로 실행해 본 분이 계신가요?

그렇습니다. 실제로는 그것만 있으면 됩니다. 전체 재빌드(rebuild) 오류를 붙여넣어 주시겠습니까? 아마도 비밀번호가 필요하거나, TLS가 필수이거나, 도메인에 접근할 수 없는 경우일 것입니다. 재빌드 로그에서 어느 쪽인지 명확하게 확인될 것입니다.

대략 여기까지입니다. 로그의 위쪽에 몇 가지 경고가 있습니다:

warning " > @mixer/parallel-prettier@2.0.3" has unmet peer dependency "prettier@^2.0.0".
warning "eslint-config-discourse > eslint-plugin-lodash@7.1.0" has unmet peer dependency "lodash@>=4".
warning " > babel-plugin-debug-macros@0.4.0-pre1" has unmet peer dependency "@babel/core@^7.0.0".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/aws-s3@3.0.6" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/aws-s3-multipart@3.1.3" has incorrect peer dependency "@uppy/core@^3.1.2".
warning "workspace-aggregator-3fff36d0-9fd8-4d1a-ac4c-d10694a59627 > discourse > @uppy/xhr-upload@3.1.1" has incorrect peer dependency "@uppy/core@^3.1.2".

하지만 컨테이너화된 Redis로 다시 빌드해도 이 경고들은 여전히 존재합니다.

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 581 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.2.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
2533af220cc44d8c77bc12c17ed7635dee49ba7f280[…]

업데이트:

오류가 아니라 INFO로 표시된 줄을 발견했는데, 이것이 원인이 아닐까 싶습니다:

I, [2023-04-06T18:44:02.460059 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'LOAD_PLUGINS=0 bundle exec rake plugin:pull_compatible_all'
I, [2023-04-06T18:44:04.581741 #1]  INFO -- : docker_manager is already at latest compatible version

I, [2023-04-06T18:44:04.581929 #1]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
Discourse requires Redis 6.2.0 or up
I, [2023-04-06T18:44:05.937604 #1]  INFO -- :

그리고 꽤 최신인 Ubuntu 22.04.2 LTS는 다음 버전을 제공합니다:

Package: redis-server
Architecture: amd64
Version: 5:6.0.16-1ubuntu1

아.. 이 버전을 사용할 수 있는 방법이 없겠네요, 그렇죠?

Discourse가 6.2에서 처음 도입된 몇 가지 Redis 명령어를 사용하는 것 같습니다.

Redis 공식 APT 저장소를 사용하여 설치할 수도 있습니다:

https://redis.io/docs/getting-started/installation/install-redis-on-linux/

네, 말씀하신 대로 정확히 그렇게 하고 있습니다. 감사합니다. 다만 그 메시지가 INFO(수많은 다른 INFO 메시지들 사이에서)가 아니라 ERROR로 표시되고, 즉시 중단되기를 바랄 뿐입니다. 그 줄을 놓치고 온갖 것들을 디버깅하느라 시간을 많이 낭비했습니다.

Redis는 리소스를 많이 사용하지 않지만 여러 서버와 공유할 수 없습니다. 이미 작동하고 있는 Discourse의 Redis를 그대로 사용하는 것이 좋습니다.