컨테이너가 두 개 있을 때 복구를 수행하는 방법?

작은 질문 하나: data 컨테이너와 web_only 컨테이너가 별도로 존재하는 환경에서 복원(restore)을 어떻게 수행해야 하나요? 먼저 data 컨테이너 안에서 이 howto를 시도해 보았습니다:

root@docker2:/var/discourse# ./launcher enter data
x86_64 arch detected.
root@docker2-data:/# discourse enable_restore
bash: discourse: command not found

Discourse 앱은 web 컨테이너에 있습니다. 하지만 여기서 복원을 시도하면 예외가 발생하고 오류로 종료됩니다:

Restore are now permitted. Disable them with `disable_restore`
root@forum:/var/www/discourse# discourse restore netzwissen-forum-2023-10-07-125819-v20230913194832.tar.gz
Plugin name is 'discourse-topic-voting', but plugin directory is named 'discourse-voting'
Starting restore: netzwissen-forum-2023-10-07-125819-v20230913194832.tar.gz
[STARTED]
'system' has started the restore!
Marking restore as running...
Making sure /var/www/discourse/tmp/restores/default/2023-10-07-132317 exists...
Copying archive to tmp directory...
EXCEPTION: /var/www/discourse/lib/discourse.rb:138:in `exec': Failed to copy archive to tmp directory.
cp: cannot stat '/var/www/discourse/public/backups/default/netzwissen-forum-2023-10-07-125819-v20230913194832.tar.gz': No such file or directory
/var/www/discourse/lib/discourse.rb:172:in `execute_command'
/var/www/discourse/lib/discourse.rb:138:in `exec'
/var/www/discourse/lib/discourse.rb:34:in `execute_command'
/var/www/discourse/lib/backup_restore/local_backup_store.rb:47:in `download_file'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:62:in `copy_archive_to_tmp_directory'
/var/www/discourse/lib/backup_restore/backup_file_handler.rb:22:in `decompress'
/var/www/discourse/lib/backup_restore/restorer.rb:42:in `run'
script/discourse:149:in `restore'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
script/discourse:290:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Trying to rollback...
There was no need to rollback
Cleaning stuff up...
Removing tmp '/var/www/discourse/tmp/restores/default/2023-10-07-132317' directory...
Marking restore as finished...
Notifying 'system' of the end of the restore...
Finished!
[FAILED]
Restore done.

data와 web 컨테이너가 분리된 배포 환경에서 복원을 성공적으로 수행하는 비결은 무엇인가요?

감사합니다, Thommie

백업을 /var/discourse/shared/web-only/default 경로에 업로드했나요?

다음 명령을 실행할 수 있습니다.

discourse restore

사용 가능한 백업 목록을 가져오기 위해서입니다.

또한 web only에서 백업을 실행하여 백업 파일이 어디에 저장되는지 확인하면, 자신의 백업을 올바른 위치에 놓는지 알 수 있습니다.

수정: OP를 수정하여 다음 내용을 추가했습니다:

도움이 될까요?

음,
아직도 작동하지 않네요.

백업 파일은 여기에 있습니다:

thommie@docker2:/var/discourse/shared/web-only$ ls  
backups  log  netzwissen-forum-2023-10-09-201019-v20230913194832.tar.gz

그리고

root@docker2:/var/discourse# ./launcher enter web_only

x86_64 arch detected.  
root@forum:/var/www/discourse#

root@forum:/var/www/discourse# discourse restore  
You must provide a filename to restore. Did you mean one of the following?  
  
discourse restore forum-netzwissen-eu-2023-10-08-033221-v20230926165821.tar.gz

즉, 복원 목록에는 새 포럼 인스턴스(백업 대상)의 web_only 컨테이너 안쪽에 있는 백업 파일만 표시됩니다. 호스트 시스템의 /var/discourse/shared/web-only/ 에 있는 소스 인스턴스의 백업 파일은 표시되지 않네요.

즉, "discourse restore"는 호스트의 매핑된 볼륨을 사용하지 않고 컨테이너 안쪽의 볼륨만 사용하고 있습니다.

??

/var/discourse/shared/web-only/backups/default 경로에 있어야 합니다.

컨테이너 안에서 다음을 실행해 보세요.

 discourse backup

그리고 백업이 어디에 저장되는지 확인한 후, 자신의 백업 파일을 같은 위치에 두세요.

@pfaffman 맞아요, 제가 잘못된 폴더에 있었습니다. 복원이 성공적으로 완료되었습니다.

도움 주셔서 감사합니다!