![]() $ docker exec pg ls -l /var/lib/postgresql/data total 4 drwx- 19 postgres root 4096 Feb 4 23:41 pgdata ![]() $ docker logs -tail=1 pg 23:41:42.717 UTC LOG: database system is ready to accept connections But, unfortunately does not work on postgres 14.1 image. All of the chown operations will work because it's not trying to chown the base directory (which is the nfs mount). Your container will mount /var/lib/postgresql/data and create the pgdata directory. So if you set the environment variable PGDATA to /var/lib/postgresql/data/pgdata and your mountPath stays as /var/lib/postgresql/data then all is well. The default is /var/lib/postgresql/data, but if the data volume you're using is a filesystem mountpoint (like with GCE persistent disks), Postgres initdb recommends a subdirectory (for example /var/lib/postgresql/data/pgdata ) be created to contain the data. PGDATA: This optional variable can be used to define another location - like a subdirectory - for the database files. I don't think you should add "no_root_squash" to your exports. I want to update this issue because I think people are still hitting it via google. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |