0

I'm trying to get REPMGR setup, and I'm following the steps at https://repmgr.org/docs/current/quickstart-standby-preparation.html to get the standby setup.

I noticed it warns On the standby, do not create a PostgreSQL instance. However I believe this happens automatically with how I installed Postgres

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |sudo tee  /etc/apt/sources.list.d/pgdg.list
sudo apt update
sudo apt -y install postgresql-12 postgresql-client-12

because when I try to clone the primary onto the standby as mentioned in https://repmgr.org/docs/current/quickstart-standby-clone.html
$ repmgr -h node1 -U repmgr -d repmgr -f /etc/repmgr.conf standby clone --dry-run

I get

postgres@empty2:~$ repmgr -h 192.168.1.102 -U repmgr -d repmgr -f /etc/repmgr.conf standby clone --dry-run
NOTICE: destination directory "/var/lib/postgresql/12/main" provided
ERROR: specified data directory "/var/lib/postgresql/12/main" appears to contain a running PostgreSQL instance
HINT: ensure the target data directory does not contain a running PostgreSQL instance

Now I'm just ASSUMING that this is because the database instance was created when I installed postgres on the standby. and I'm also ASSUMING that I can just delete everything in the data directory on the standby, and everything will work ok...

But (assuming my assumptions are correct....) what is the correct way to install postgres12 without creating an instance and the corresponding data files?

3
  • 1
    I don't know, but you can always use systemctl stop and systemctl disable to stop the server and manually removing the cluster. Feb 14, 2020 at 7:34
  • would pg_dropcluster by the best approach to remove it?
    – dangel
    Feb 15, 2020 at 2:18
  • On Debian/Ubuntu systems, yes. Feb 17, 2020 at 6:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.