L'aggiornamento di PostgreSQL fallisce dalla Cina

Impossibile ricostruire i dati

./launcher rebuild data
Rilevata architettura x86_64.
Aggiornamento del launcher in corso
Launcher aggiornato
2.0.20250129-0720: Estrazione da docker-hub-china/discourse-base
Digest: sha256:d798a945ca4d31c29e5d263cdaf807bafab9b5f6737be0b1b852bea0063a3b91
Stato: Immagine aggiornata per registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250129-0720
registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250129-0720
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-02-06T04:49:43.809493 #1]  INFO -- : Lettura da stdin
I, [2025-02-06T04:49:43.812252 #1]  INFO -- : Hook before_code mancante saltato
I, [2025-02-06T04:49:43.812294 #1]  INFO -- : Hook before_db_migrate mancante saltato
I, [2025-02-06T04:49:43.812309 #1]  INFO -- : Hook after_code mancante saltato
I, [2025-02-06T04:49:43.816721 #1]  INFO -- : File > /etc/service/postgres/run chmod: +x chown:
I, [2025-02-06T04:49:43.820580 #1]  INFO -- : File > /etc/service/postgres/log/run chmod: +x chown:
I, [2025-02-06T04:49:43.824283 #1]  INFO -- : File > /etc/runit/3.d/99-postgres chmod: +x chown:
I, [2025-02-06T04:49:43.827979 #1]  INFO -- : File > /root/install_postgres chmod: +x chown:
I, [2025-02-06T04:49:43.832007 #1]  INFO -- : File > /root/upgrade_postgres chmod: +x chown:
I, [2025-02-06T04:49:43.832273 #1]  INFO -- : Sostituzione di data_directory = '/var/lib/postgresql/15/main' con data_directory = '/shared/postgres_data' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.832904 #1]  INFO -- : Sostituzione di (?-mix:#?listen_addresses *=.*) con listen_addresses = '*' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.833313 #1]  INFO -- : Sostituzione di (?-mix:#?synchronous_commit *=.*) con synchronous_commit = $db_synchronous_commit in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.843122 #1]  INFO -- : Sostituzione di (?-mix:#?shared_buffers *=.*) con shared_buffers = $db_shared_buffers in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.843548 #1]  INFO -- : Sostituzione di (?-mix:#?work_mem *=.*) con work_mem = $db_work_mem in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.843885 #1]  INFO -- : Sostituzione di (?-mix:#?default_text_search_config *=.*) con default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.844162 #1]  INFO -- : Sostituzione di (?-mix:#?checkpoint_segments *=.*) con checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.844439 #1]  INFO -- : Sostituzione di (?-mix:#?logging_collector *=.*) con logging_collector = $db_logging_collector in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.844732 #1]  INFO -- : Sostituzione di (?-mix:#?log_min_duration_statement *=.*) con log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T04:49:43.845050 #1]  INFO -- : Sostituzione di (?-mix:^#local +replication +postgres +peer$) con local replication postgres  peer in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T04:49:43.845283 #1]  INFO -- : Sostituzione di (?-mix:^host.*all.*all.*127.*$) con host all all 0.0.0.0/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T04:49:43.845505 #1]  INFO -- : Sostituzione di (?-mix:^host.*all.*all.*::1\/128.*$) con host all all ::/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T04:49:43.845723 #1]  INFO -- : > if [ -f /root/install_postgres ]; then
  /root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres already running stop container ; exit 1
fi

2025/02/06 04:49:45 socat[33] E connect(, AF=1 "/shared/postgres_run/.s.PGSQL.5432", 36): Connection refused
initdb: warning: abilitazione dell'autenticazione "trust" per le connessioni locali
initdb: hint: È possibile modificarlo modificando pg_hba.conf o utilizzando l'opzione -A, o --auth-local e --auth-host, la prossima volta che si esegue initdb.

I registri sembrano incompleti, ma lo snippet seguente può fornire un indizio.

socat[33] E connect(, AF=1 “/shared/postgres_run/.s.PGSQL.5432”, 36): Connection refused

Stai riscontrando anche l’errore sottostante molto più in basso nell’output del log?

The source cluster was not shut down cleanly

Se sĂŹ, puoi provare a seguire queste istruzioni.

Nessun contenitore in esecuzione

Stai riscontrando errori in questo primo passaggio?

Ho usato i metodi data.yml e web_only.yml

Puoi ancora seguire le stesse istruzioni, ma sostituendo qualsiasi occorrenza di app o standalone con data.

Ancora non connesso

$ ./launcher enter data
Rilevata architettura x86_64.
root@sober-data:/# export SVWAIT=300
sv stop nginx
sv stop unicorn
sv stop postgres
exit
fail: nginx: impossibile cambiare la directory del servizio: file non esiste
fail: unicorn: impossibile cambiare la directory del servizio: file non esiste
ok: down: postgres: 0s, normalmente su
logout

Questo implica che eri connesso al container. (Assicurati solo che il container web_only rimanga fermo durante la ricostruzione del container data.)

ok: down: postgres: 0s, normally up

Questo è l’output che conta. Significa che postgres si è ora arrestato in modo pulito e puoi procedere con i passaggi successivi.

 ./launcher entra  dati
architettura x86_64 rilevata.
root@sober-data:/# sv stop postgres
ok: spento: postgres: 0s, normalmente in funzione
root@sober-data:/# exit
logout
root@sober:/var/discourse$ ./launcher ricostruisci  dati
architettura x86_64 rilevata.
Assicurando che il launcher sia aggiornato
Il launcher è aggiornato
 Arrestare il vecchio contenitore
+ /usr/bin/docker stop -t 600 dati
dati
2.0.20250129-0720: Sto tirando da docker-hub-china/discourse-base
Digest: sha256:d798a945ca4d31c29e5d263cdaf807bafab9b5f6737be0b1b852bea0063a3b91
Status: Immagine aggiornata per registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250129-0720
registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250129-0720
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-02-06T06:19:20.379635 #1]  INFO -- : Lettura da stdin
I, [2025-02-06T06:19:20.380959 #1]  INFO -- : Hook before_code mancante ignorato
I, [2025-02-06T06:19:20.380976 #1]  INFO -- : Hook before_db_migrate mancante ignorato
I, [2025-02-06T06:19:20.380983 #1]  INFO -- : Hook after_code mancante ignorato
I, [2025-02-06T06:19:20.383923 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown: 
I, [2025-02-06T06:19:20.386435 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown: 
I, [2025-02-06T06:19:20.389343 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown: 
I, [2025-02-06T06:19:20.391719 #1]  INFO -- : File > /root/install_postgres  chmod: +x  chown: 
I, [2025-02-06T06:19:20.394375 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown: 
I, [2025-02-06T06:19:20.394471 #1]  INFO -- : Sostituendo data_directory = '/var/lib/postgresql/15/main' con data_directory = '/shared/postgres_data' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.394742 #1]  INFO -- : Sostituendo (?-mix:#?listen_addresses *=.*) con listen_addresses = '*' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.394972 #1]  INFO -- : Sostituendo (?-mix:#?synchronous_commit *=.*) con synchronous_commit = $db_synchronous_commit in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.395126 #1]  INFO -- : Sostituendo (?-mix:#?shared_buffers *=.*) con shared_buffers = $db_shared_buffers in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.395261 #1]  INFO -- : Sostituendo (?-mix:#?work_mem *=.*) con work_mem = $db_work_mem in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.395400 #1]  INFO -- : Sostituendo (?-mix:#?default_text_search_config *=.*) con default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.395510 #1]  INFO -- : Sostituendo (?-mix:#?checkpoint_segments *=.*) con checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.395622 #1]  INFO -- : Sostituendo (?-mix:#?logging_collector *=.*) con logging_collector = $db_logging_collector in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.395723 #1]  INFO -- : Sostituendo (?-mix:#?log_min_duration_statement *=.*) con log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T06:19:20.395845 #1]  INFO -- : Sostituendo (?-mix:^#local +replication +postgres +peer$) con local replication postgres  peer in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T06:19:20.395930 #1]  INFO -- : Sostituendo (?-mix:^host.*all.*all.*127.*$) con host all all 0.0.0.0/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T06:19:20.396007 #1]  INFO -- : Sostituendo (?-mix:^host.*all.*all.*::1\/128.*$) con host all all ::/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T06:19:20.396096 #1]  INFO -- : > if [ -f /root/install_postgres ]; then
  /root/install_postgres  && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres giĂ  in esecuzione, ferma il contenitore ; exit 1
fi

initdb: avviso: abilitazione dell'autenticazione "trust" per le connessioni locali
initdb: suggerimento: Puoi modificare questo impostando pg_hba.conf o usando l'opzione -A, o --auth-local e --auth-host, la prossima volta che esegui initdb.

La ricostruzione è bloccata in questo punto? Se sÏ, annullala ed esegui invece questo, quindi pubblica i risultati.

./launcher start data
./launcher enter data
psql --version
apt-get update

Grazie mille. Lasciami tornare alla versione Docker e a postgres.template.yml

./launcher rebuild data
architettura x86_64 rilevata.
Assicurando che il launcher sia aggiornato
Launcher aggiornato
Interrompendo il vecchio container
+ /usr/bin/docker stop -t 600 data
data
2.0.20250129-0720: Pulling da docker-hub-china/discourse-base
Digest: sha256:d798a945ca4d31c29e5d263cdaf807bafab9b5f6737be0b1b852bea0063a3b91
Stato: L'immagine è aggiornata per registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250129-0720
registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250129-0720
/usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups.rb
/usr/local/bin/pups --stdin
I, [2025-02-06T07:02:42.768651 #1]  INFO -- : Lettura da stdin
I, [2025-02-06T07:02:42.769907 #1]  INFO -- : Hook before_code mancante ignorato
I, [2025-02-06T07:02:42.769923 #1]  INFO -- : Hook before_db_migrate mancante ignorato
I, [2025-02-06T07:02:42.769933 #1]  INFO -- : Hook after_code mancante ignorato
I, [2025-02-06T07:02:42.772767 #1]  INFO -- : File > /etc/service/postgres/run  chmod: +x  chown: 
I, [2025-02-06T07:02:42.775230 #1]  INFO -- : File > /etc/service/postgres/log/run  chmod: +x  chown: 
I, [2025-02-06T07:02:42.777690 #1]  INFO -- : File > /etc/runit/3.d/99-postgres  chmod: +x  chown: 
I, [2025-02-06T07:02:42.779645 #1]  INFO -- : File > /root/install_postgres  chmod: +x  chown: 
I, [2025-02-06T07:02:42.781825 #1]  INFO -- : File > /root/upgrade_postgres  chmod: +x  chown: 
I, [2025-02-06T07:02:42.781974 #1]  INFO -- : Sostituendo data_directory = '/var/lib/postgresql/15/main' con data_directory = '/shared/postgres_data' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.782261 #1]  INFO -- : Sostituendo (?-mix:#?listen_addresses *=.*) con listen_addresses = '*' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.782427 #1]  INFO -- : Sostituendo (?-mix:#?synchronous_commit *=.*) con synchronous_commit = $db_synchronous_commit in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.782551 #1]  INFO -- : Sostituendo (?-mix:#?shared_buffers *=.*) con shared_buffers = $db_shared_buffers in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.782661 #1]  INFO -- : Sostituendo (?-mix:#?work_mem *=.*) con work_mem = $db_work_mem in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.782762 #1]  INFO -- : Sostituendo (?-mix:#?default_text_search_config *=.*) con default_text_search_config = '$db_default_text_search_config' in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.782877 #1]  INFO -- : Sostituendo (?-mix:#?checkpoint_segments *=.*) con checkpoint_segments = $db_checkpoint_segments in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.782974 #1]  INFO -- : Sostituendo (?-mix:#?logging_collector *=.*) con logging_collector = $db_logging_collector in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.783076 #1]  INFO -- : Sostituendo (?-mix:#?log_min_duration_statement *=.*) con log_min_duration_statement = $db_log_min_duration_statement in /etc/postgresql/15/main/postgresql.conf
I, [2025-02-06T07:02:42.783180 #1]  INFO -- : Sostituendo (?-mix:#?local +replication +postgres +peer$) con local replication postgres  peer in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T07:02:42.783258 #1]  INFO -- : Sostituendo (?-mix:^host.*all.*all.*127.*$) con host all all 0.0.0.0/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T07:02:42.783334 #1]  INFO -- : Sostituendo (?-mix:^host.*all.*all.*::1\/128.*$) con host all all ::/0 md5 in /etc/postgresql/15/main/pg_hba.conf
I, [2025-02-06T07:02:42.783416 #1]  INFO -- : > se [ -f /root/install_postgres ]; then
  /root/install_postgres && rm -f /root/install_postgres
elif [ -e /shared/postgres_run/.s.PGSQL.5432 ]; then
  socat /dev/null UNIX-CONNECT:/shared/postgres_run/.s.PGSQL.5432 || exit 0 && echo postgres giĂ  in esecuzione, stoppa il contenitore ; exit 1
fi

initdb: warning: abilitando l'autenticazione "trust" per le connessioni locali
initdb: suggerimento: Puoi modificare questo impostando pg_hba.conf o usando l'opzione -A, o --auth-local e --auth-host, la prossima volta che esegui initdb.

2.0.20250129-0720: Tirogit da docker-hub-china/discourse-base

Puoi confermare se il tuo server si trova in Cina?

Lo specchio non è un problema, questo è il metodo di accelerazione della rete cinese dello specchio, altrimenti lo specchio non ha velocità di rete.

Ho spostato le tue query in un nuovo argomento. Credo che questo sia correlato all’esecuzione dell’aggiornamento dalla Cina.

Basandoti sull’output del log, il rebuild sembra fallire durante apt-get update. Ti consiglierei di usare una VPN per connettere il tuo server ai repository apt.

Eseguo anche un processo di accelerazione di rete cinese per apt-get update. Vorrei sapere quale software viene aggiornato principalmente per apt-get update

Preferirei sapere qual è la causa principale per cui /shared/postgres_run/.s.PGSQL.5432 non può connettersi

Riesci a raggiungere il repository sottostante dal tuo server?

curl -v https://apt.postgresql.org/pub/repos/apt/

Il repository è necessario per installare i vecchi pacchetti PostgreSQL utilizzati durante l’aggiornamento.

Questo è tipicamente causato quando il database non è stato arrestato correttamente. Lo avevamo risolto in precedenza quando hai avviato e arrestato il container data. L’errore non viene visualizzato nel tuo ultimo output di log.

1 Mi Piace

Intendi che la versione di PostgreSQL è troppo vecchia, causando problemi. Questo aggiornamento può essere integrato nell’elaborazione di Discourse/base nello specchio. Uso lo specchio Discourse/base: 2.0.20250129-0720.

C’è qualche problema con la mia comprensione? Qual è il numero di versione di PostgreSQL che funziona correttamente e il numero di versione di PostgreSQL che presenta problemi?

O forse il problema risiede nel fatto che lo specchio che sto usando è troppo recente, causando problemi con la build dei dati. Devo costruire i dati utilizzando lo specchio Discourse/base: 2.0.20250114-0014 per accogliere l’aggiornamento di PostgreSQL.

Ho ricevuto l’aggiornamento PostgreSQL15

I template devono essere utilizzati in sequenza

postgres.13.template.yml
postgres.15.template.yml
postgres.template.yml

Configurazione dell’accelerazione di rete in Cina per i file postgres.13.template.yml, postgres.15.template.yml

run:
  - exec: cat /etc/os-release && psql --version
  - exec: |
      if [ -f /etc/apt/sources.list ]; then
        sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
      else
        echo "deb http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware" | sudo tee /etc/apt/sources.list
        echo "deb http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware" | sudo tee -a /etc/apt/sources.list
      fi
  - exec: |
      if [ -f /etc/apt/sources.list.d/debian.sources ]; then
        sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources
      else
        sudo bash -c 'cat > /etc/apt/sources.list.d/debian.sources <<EOF
        URIs: http://mirrors.ustc.edu.cn/debian
        Suites: bookworm bookworm-updates
        Components: main contrib non-free non-free-firmware
        Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg

        Types: deb
        URIs: http://mirrors.ustc.edu.cn/debian-security
        Suites: bookworm-security
        Components: main contrib non-free non-free-firmware
        Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
        EOF'
      fi
  - exec: cat /etc/apt/sources.list && cat /etc/apt/sources.list.d/debian.sources
2 Mi Piace

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