Skip to content
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

Use the same volume of old pgmaster when brings it back to the cluster #216

Open
fhbenatti opened this issue Feb 27, 2019 · 1 comment
Open

Comments

@fhbenatti
Copy link

fhbenatti commented Feb 27, 2019

Guys, sorry for rising up this question again, but i need some instructions to how recreate a service for pgmaster to join in the cluster like slave.

After read some posted issues i noticed witch the correct manner to do this is removed the old service pgmaster and creates a new one:

#4 (comment)

If I understand all of this correct, you should change master to standby config before returning it in cluster or using PARTNERS_NODE
Here described how to return master to cluster:
https://stackoverflow.com/questions/37710868/how-to-promote-master-after-failover-on-postgresql-with-docker
And here we had had discussion about its process:
#178
If I'm wrong, please attach your configuration for more clear understanding.
Originally posted by @Kealman in #184 (comment)

But, is it possible to reuse a previous volume used for old master?

I always need to create a new volume to add a new service pgmaster, otherwise, i get the same error mentioned in issue #184. I want to reuse a previous volume to avoid a full backup (doing a rewind, instead) for the new instance master.

Just for testing, i'd created a new docker-compose file to create a new service for pgmaster:

AddNewNode.docker-compose.yml

pgmaster:
    image: postdock/postgres:latest-postgres10-repmgr40
    environment:
      NODE_ID: 3
      NODE_NAME: node1
      CLUSTER_NODE_NETWORK_NAME: pgmaster
      SSH_ENABLE: 0
      PARTNER_NODES: 'pgmaster,pgslave1'
      REPLICATION_PRIMARY_HOST: pgslave1
      CLEAN_OVER_REWIND: 1
      CONFIGS_DELIMITER_SYMBOL: ;
      CONFIGS: 'max_replication_slots:10'
    ports:
      - 5422:5432
    volumes:
      - pgmaster:/var/lib/postgresql/data
      - ./ssh:/home/postgres/.ssh/keys
    networks:
      cluster:
        aliases:
          - pgmaster

And then, run:

docker-compose -f "AddNewNode.docker-compose.yml" up

As i said, I got the same error mentioned in issue #184.

Is there any wrong parameter in my AddNewNode.docker-compose.yml file?

@fhbenatti fhbenatti changed the title Failover: Use the same volume of old master Use the same volume of old pgmaster when brings it back to the cluster Feb 27, 2019
@ghost
Copy link

ghost commented Dec 11, 2019

Any update about this issue please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants