Code Monkey home page Code Monkey logo

Comments (5)

stephane-klein avatar stephane-klein commented on August 24, 2024 1

@tianon what to you think to add pg_ctl start + pg_ctl stop step before execute pg_upgrade to avoid The source cluster was not shut down cleanly error?

from docker-postgres-upgrade.

snspinn avatar snspinn commented on August 24, 2024 1

I found that running docker exec --user postgres POSTGRES bash -c "pg_ctl stop" worked --> where POSTGRES is the name of the original (and running) postgres container. Just make sure that docker (or docker-compose) is not setup to restart your container on failure.

I wonder if the container/docker runs pg_ctl stop with the 'immediate' directive, i.e. pg_ctl stop -m i?

from docker-postgres-upgrade.

stephane-klein avatar stephane-klein commented on August 24, 2024

This is how I fixed it:

docker run -it --rm -v `pwd`/:/var/lib/postgresql/ tianon/postgres-upgrade:9.4-to-12 bash
su postgres
$PGBINOLD/pg_ctl start -w -D $PGDATAOLD
$PGBINOLD/pg_ctl stop -w -D $PGDATAOLD
exit

Next I can start this with success:

docker run --rm -v `pwd`/:/var/lib/postgresql tianon/postgres-upgrade:9.4-to-12

from docker-postgres-upgrade.

harobed avatar harobed commented on August 24, 2024

Same commands in one line:

docker run -it --rm -v `pwd`/:/var/lib/postgresql/ tianon/postgres-upgrade:9.4-to-12 su postgres -c "\$PGBINOLD/pg_ctl start -w -D \$PGDATAOLD ; \$PGBINOLD/pg_ctl stop -w -D \$PGDATAOLD; /usr/local/bin/; /usr/local/bin/docker-upgrade"

from docker-postgres-upgrade.

stephane-klein avatar stephane-klein commented on August 24, 2024

Before:

docker run -it --rm -v `pwd`/:/var/lib/postgresql/ tianon/postgres-upgrade:9.4-to-12 su postgres -c "\$PGBINOLD/pg_ctl start -w -D \$PGDATAOLD ; \$PGBINOLD/pg_ctl stop -w -D \$PGDATAOLD; /usr/local/bin/; /usr/local/bin/docker-upgrade"

Don't forget to execute:

# chown 999 ./ -R

from docker-postgres-upgrade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.