pg_easy_replicate

Description: Set up logical replication between two PostgreSQL databases.

Category: Storage

URL: https://railway.app/template/MfqQcU

10 Replies

keshavk2910PRO

a year ago

How can we run this on railway. Can you share steps please?

Thanks


a year ago

I've never used this before but I assume it's as simple as -

Open your project that contains your two postgres databases, deploy this template, fill out the two required variables.


keshavk2910PRO

a year ago

I did the same but there are no variables for commands that are mentioned in github repo like how much time between replications and how to check stats


a year ago

Yes that would be up to you to add at your discretion based on what settings you would like to configure.


keshavk2910PRO

a year ago

Got it, Thanks for help


I couldn't figure out how to start the replication, the logs just show

Switch to inspect mode.

Help ?


a year ago

Have you provided both database URLs?


ralengPRO

a year ago

I couldn't figure out how to start the replication, the logs just show

Switch to inspect mode.

Help ?

You can use the custom start command to interact with the container. Deploy the container first with:

pgeasyreplicate bootstrap --group-name yourgroupname

and then start the sync by redeploying the container with this start command

pgeasyreplicate start_sync --group-name yourgroupname

You need to make sure the db instances are properly configured (wallevel "logical"), and you probably need to copy the schema manually. I had an issue using the --copy-schema option, since the pgdump version the container uses is v15, while the Postgres DBs in Railway are v16.

Hope this helps.


salieflewisPRO

a year ago

I couldn't figure out how to start the replication, the logs just show

Switch to inspect mode.

Help ?

You can use the custom start command to interact with the container. Deploy the container first with:

pgeasyreplicate bootstrap --group-name yourgroupname

and then start the sync by redeploying the container with this start command

pgeasyreplicate start_sync --group-name yourgroupname

You need to make sure the db instances are properly configured (wallevel "logical"), and you probably need to copy the schema manually. I had an issue using the --copy-schema option, since the pgdump version the container uses is v15, while the Postgres DBs in Railway are v16.

Hope this helps.

My understanding is that Railway's Postgres template doesn't support making adjustments to the Postgres configuration file. My workaround for this was to attempt to deploy a forked version of their template with the necessary configuration to treat that instance as a publisher. How did you get around this?


salieflewis

I couldn't figure out how to start the replication, the logs just showSwitch to inspect mode.Help ?You can use the custom start command to interact with the container. Deploy the container first with:pgeasyreplicate bootstrap --group-name yourgroupnameand then start the sync by redeploying the container with this start commandpgeasyreplicate start_sync --group-name yourgroupnameYou need to make sure the db instances are properly configured (wallevel "logical"), and you probably need to copy the schema manually. I had an issue using the --copy-schema option, since the pgdump version the container uses is v15, while the Postgres DBs in Railway are v16.Hope this helps.My understanding is that Railway's Postgres template doesn't support making adjustments to the Postgres configuration file. My workaround for this was to attempt to deploy a forked version of their template with the necessary configuration to treat that instance as a publisher. How did you get around this?

suhjohnBIZCLASS

2 months ago

For posterity - you can make adjustments on postgres config
wrapper.sh postgres --port=5432 -c 'max_connections=500' -c 'shared_buffers=16GB' -c 'effective_cache_size=48GB' -c 'work_mem=32MB' -c 'maintenance_work_mem=4GB' -c 'max_worker_processes=32' -c 'max_parallel_workers=32' -c 'max_parallel_workers_per_gather=8' -c 'effective_io_concurrency=200' -c 'random_page_cost=1.1' -c 'jit=off' <- have something like this in the "Custom start command"


pg_easy_replicate - Railway Help Station