Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Please help, I have persisted it, but the table and data are not restored after restarting the container.#1256

llnancy started this conversation inGeneral
Discussion options

verion: postgres:15-alpine

Persistent mount (Similar to the following, I am sure that the persistent mounting of the data volume is successful):

volumeMounts:-name:postgresqlmountPath:/var/lib/postgresql

After restarting the container, the files in the directory are still there,

image

but the previous database and table are gone. Is there a way to restore it? How can I do it?

You must be logged in to vote

Replies: 2 comments

Comment options

Container log after restart

The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.utf8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /var/lib/postgresql/data ... okcreating subdirectories ... okselecting dynamic shared memory implementation ... posixselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting default time zone ... Asia/Shanghaicreating configuration files ... okrunning bootstrap script ... oksh: locale: not found2024-07-01 11:53:41.292 CST [30] WARNING: no usable system locales were foundperforming post-bootstrap initialization ... oksyncing data to disk ... okSuccess. You can now start the database server using:pg_ctl -D /var/lib/postgresql/data -l logfile startinitdb: warning: enabling "trust" authentication for local connectionsCREATE DATABASE/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*waiting for server to shut down....2024-07-01 11:53:41.976 CST [36] LOG: received fast shutdown request2024-07-01 11:53:41.977 CST [36] LOG: aborting any active transactions2024-07-01 11:53:41.981 CST [36] LOG: background worker "logical replication launcher" (PID 42) exited with exit code 12024-07-01 11:53:41.982 CST [37] LOG: shutting down2024-07-01 11:53:41.989 CST [37] LOG: checkpoint starting: shutdown immediate2024-07-01 11:53:42.043 CST [37] LOG: checkpoint complete: wrote 920 buffers (5.6%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.013 s, sync=0.017 s, total=0.062 s; sync files=301, longest=0.008 s, average=0.001 s; distance=4235 kB, estimate=4235 kB2024-07-01 11:53:42.049 CST [36] LOG: database system is shut downdoneserver stoppedPostgreSQL init process complete; ready for start up.2024-07-01 11:53:42.111 CST [1] LOG: starting PostgreSQL 15.6 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20231014) 13.2.1 20231014, 64-bit2024-07-01 11:53:42.112 CST [1] LOG: listening on IPv4 address "0.0.0.0", port 54322024-07-01 11:53:42.112 CST [1] LOG: listening on IPv6 address "::", port 54322024-07-01 11:53:42.121 CST [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"2024-07-01 11:53:42.139 CST [52] LOG: database system was shut down at 2024-07-01 11:53:42 CST2024-07-01 11:53:42.148 CST [1] LOG: database system is ready to accept connections
You must be logged in to vote
0 replies
Comment options

If you're using a container runtime which honors Docker's volume declarations, there's an additional mount/volume at/var/lib/postgresql/data (note the/data at the end) which I think is what you actually should've/intended to specify in yourvolumeMounts -- if that is indeed what's happened, you'll want to sort through "anonymous" volumes in your runtime's equivalent ofdocker volume ls to find the volume which contains your actual data.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@llnancy@tianon
Converted from issue

This discussion was converted from issue #1255 on July 01, 2024 21:52.


[8]ページ先頭

©2009-2025 Movatter.jp