Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 804  / 3 Years ago, wed, june 16, 2021, 7:19:10

I am trying to set up replication for PostgreSQL on Ubuntu 20.04 and for the stand-by node I just need to install the PostgreSQL-server and not run initdb. Cluster creation on the stand-by will be taken care of when I will setup replication from master.


But, when ever I am running


sudo apt-get -y install postgresql

initdb is called and cluster is created. In other distribution such as RHEL, it is possible to not run initdb and just install the postgresql server using packages (https://www.postgresql.org/download/linux/redhat/).


Is there any way to get around this? or is this just how installation works on ubuntu when installing using apt-get?


More From » apt

 Answers
3

Q: initdb is called and cluster is created. In other distribution such as RHEL, it is possible to not run initdb and just install the postgresql server


There are two ways to do that:



  1. Either set the following option to off in /etc/postgresql-common/createcluster.conf:


    # Create a "main" cluster when a new postgresql-x.y server package is installed
    create_main_cluster = off

    This configuration file is part of the postgresql-common package, which must be installed first to have the opportunity to overwrite this option ( otherwise, it will be installed automatically as a dependency of the postgresql-$VERSION package).



  2. Or create the directory /etc/postgresql/$VERSION before the postgresql-$VERSION package gets installed. The existence of this directory will make the post-installation script skip the creation of a default cluster.




[#804] Friday, June 18, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
diffeah

Total Points: 78
Total Questions: 130
Total Answers: 98

Location: Peru
Member since Fri, Oct 14, 2022
2 Years ago
;