-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
usage with the official postgresql images with a single data volume #4
Comments
@tianon I am running into this exact issue too. What are the steps for someone to upgrade the Postgres version of the data from the non-versioned volume path? Thank you. |
Not sure how I missed this, sorry! I think the
(Which should work equally well with bind mounts and volumes.) |
Thanks for the note @tianon. I tried following this part of the README exactly, but still ran into issues. I'll walk through step-by-step what I did, so hopefully we can identify the error in my approach or a possibly improvement to this project.
version: '3'
services:
db:
container_name: my_db
image: "postgres:9.4"
ports:
- "15432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
volumes:
postgres-data:
docker run --rm \
-v postgres-data:/var/lib/postgresql/data \
-v postgres-data-9.6:/var/lib/postgresql/9.6/data \
tianon/postgres-upgrade:9.4-to-9.6
My initial guess is that the script was assuming that my OLD data volume was following the directory path structure was following your recommended approach (version-based directory names), since it was unable to find the 9.4-based directory name but my project is currently using a general directory name. I am also assuming that the values I pass in the Anyway, I'd love to hear your input on my approach. I am prepared to that EUREKA moment when I realize I forgot about some critical knowledge about Docker fundamentals. But, I'm also willing to help out on a PR if one is needed. Thank you. |
Try this instead: docker run --rm \
-v postgres-data:/var/lib/postgresql/9.4/data \
-v postgres-data-9.6:/var/lib/postgresql/9.6/data \
tianon/postgres-upgrade:9.4-to-9.6 |
Ah okay. I overlooked that the part to the right of the I am running into a new type of error when I try to access my database in my application. Are you aware of what might be going on here? If this is out of scope of this project, that's okay.
|
Sounds like "pg_hba.conf" isn't right -- if you "docker exec" into the
container, you should be able to verify that the contents include the
correct auth lines necessary for your user to connect properly.
|
@tianon These are the relevant lines in my
I'm not an expert on this file, but it looks like it should be accepting all connections to me. Perhaps should there have been a update applied to this file by |
There should be a line something like "host all all all md5" or "host all
all all trust" (if you're using passwordless auth -- not recommended) which
was set up by our docker-entrypoint during the initial database
initialization.
Perhaps "pg_upgrade" didn't copy that over properly?
Regardless, adding "host all all all md5" will probably fix it.
|
No, that didn't work unfortunately. After I edited the I am wondering whether my usage of named volumes is causing an issue. The examples in the README are using absolute paths to the host machine. Perhaps this project is meant to be used with bind mounts instead of named volumes? (https://docs.docker.com/engine/admin/volumes/) |
Named volumes are just bind mounts that Docker manages the source directory
for you. 😞 😕
|
Okay, then that concern is obviously invalid and thus not the right path for me to dig deeper into. Okay, I'll have to keep trying on my end and fiddling around with Postgres files. But your help with getting this docker container to execute properly on my system was useful. Thank you. |
@tianon Is there the possibility of making the migration with with the folder structure in the the default postgresql image but still get the speed benefits of separate version folders? I have a VERY large database so this will make a huge difference. |
@lanrat sure, just set |
@ecbrodie - got a team of engineers here running into the same problem, we seem to be missing lines from pg_hba.conf. Did you ever solve this problem? |
@jbcpollak You can compare |
Just seeing this now. @jbcpollak I switched projects last year and thus no longer had to deal with the same problem. On my old project, I was spiking out a postgres upgrade for a Dockerized app. However, I switches gears because we delayed our upgrade. Anyway, I hope you figured it out on your end over the last year plus. I have nothing left to contribute to this thread. |
@ecbrodie - we solved this problem a long while ago, sadly I can't remember how. Someone else posted a comment here today saying they had the same issue but it looks like the comment has been deleted. As far as I'm concerned the problem is closed, but I'll ask my co-workers if they remember our solution and to post back here. |
This one is related to the issue with |
The official docker library PostgreSQL image uses a single directory/volume to store all of its configuration and data
/var/lib/postgresql/data
and does not use a version folder like your scripts seem to want ex:/var/lib/postgresql/9.5/data
.Is there a way to use this tool with the folder layout presented by the PostgreSQL image from the docker library, without having to move everything between two different volumes?
The text was updated successfully, but these errors were encountered: