我已將我的 Airbyte 影像從 更新0.35.2-alpha為0.35.37-alpha. [在 Kubernetes 中運行]
當系統推出時,db pod 不會終止,我 [一個可怕的錯誤] 洗掉了 pod。當它恢復時,我收到一個錯誤 -
PostgreSQL Database directory appears to contain a database; Skipping initialization
2022-02-24 20:19:44.065 UTC [1] LOG: starting PostgreSQL 13.6 on x86_64-pc-linux-musl, compiled by gcc (Alpine 10.3.1_git20211027) 10.3.1 20211027, 64-bit
2022-02-24 20:19:44.065 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2022-02-24 20:19:44.065 UTC [1] LOG: listening on IPv6 address "::", port 5432
2022-02-24 20:19:44.071 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2022-02-24 20:19:44.079 UTC [21] LOG: database system was shut down at 2022-02-24 20:12:55 UTC
2022-02-24 20:19:44.079 UTC [21] LOG: invalid resource manager ID in primary checkpoint record
2022-02-24 20:19:44.079 UTC [21] PANIC: could not locate a valid checkpoint record
2022-02-24 20:19:44.530 UTC [1] LOG: startup process (PID 21) was terminated by signal 6: Aborted
2022-02-24 20:19:44.530 UTC [1] LOG: aborting startup due to startup process failure
2022-02-24 20:19:44.566 UTC [1] LOG: database system is shut down
很確定 WAL 檔案已損壞,但我不知道如何解決這個問題。
uj5u.com熱心網友回復:
警告- 可能會丟失資料
這是一個測驗系統,所以我不關心保持最新的交易,也沒有備份。
首先,我覆寫了容器命令以保持容器運行,但不嘗試啟動 postgres。
...
spec:
containers:
- name: airbyte-db-container
image: airbyte/db
command: ["sh"]
args: ["-c", "while true; do echo $(date -u) >> /tmp/run.log; sleep 5; done"]
...
并在豆莢上生成了一個貝殼——
kubectl exec -it -n airbyte airbyte-db-xxxx -- sh
跑步pg_reset_wal
# dry-run first
pg_resetwal --dry-run /var/lib/postgresql/data/pgdata
成功!
pg_resetwal /var/lib/postgresql/data/pgdata
Write-ahead log reset
然后把容器里的temp命令去掉,postgres就正常啟動了!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/434286.html
