Come eseguire un ripristino quando si hanno due container?

Piccola domanda: come eseguire il ripristino quando si hanno più container (data e web_only). Ho provato prima questa guida dall’interno del container dei dati:

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

OK, l’app discourse si trova nel container web. Ma qui il ripristino genera un’eccezione e termina con un errore:

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/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.

Qual è il trucco per far funzionare il ripristino su deploy con container dati e web separati?

Grazie, Thommie

Hai caricato il backup in /var/discourse/shared/web-only/default?

Puoi eseguire

discourse restore

Per ottenere un elenco dei backup disponibili.

Puoi anche eseguire un backup solo sul web per vedere dove inserisce il suo valore in modo da sapere dove stai inserendo il tuo nel posto giusto.

MODIFICA: Ho modificato l’OP e aggiunto questo:

Questo aiuta?

Hmmm,
non funziona ancora

Ho il file di backup qui:

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

Poi

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

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

root@forum:/var/www/discourse# discourse restore
Devi fornire un nome file per il ripristino. Volevi dire uno dei seguenti?

  
discourse restore forum-netzwissen-eu-2023-10-08-033221-v20230926165821.tar.gz

Quindi, il ripristino mostra solo un file di backup da dentro il container web_only della nuova istanza del forum (la destinazione del backup). Ma non il file di backup dall’istanza di origine che è disponibile su /var/discourse/shared/web-only/ sul sistema HOST

Quindi, “discourse restore” non utilizza il volume mappato sull’host, ma solo quello all’interno del container.

??

deve trovarsi in /var/discourse/shared/web-only/backups/default

all’interno del container esegui

 discourse backup

e vedi dove salva il backup e metti il tuo nello stesso posto.

@pfaffman hai ragione, ero nella cartella sbagliata, il ripristino è terminato con successo

grazie per l’aiuto!

1 Mi Piace

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.