PostgreSQL - Running Multiple Instances Running PostgreSQL 11 and PostgreSQL 10, or any combination of major versions, on a single system is easy when using RPM packages such as the ones provided at PostgreSQL YUM reposiotry. PGDG rpms make it easy to run multiple version of PostgreSQL on a single system. Install one more PGDG versions, setup, enable services using steps shared in previous blog.
This guide will help you get started with installing and configuring multiple PostgreSQL 11 clusters on a CentOS / RHEL 7 based system, which will also work for Fedora 27, 28, 29.
PostgreSQL - Installing and Creating cluster One of the most important things to using PostgreSQL successfully in your development and production environments is simply getting started! One of the most popular ways to install PostgreSQL is by using RPM packages. The PostgreSQL RPM packages work across many Linux distributions, including, RedHat Enterprise Linux (RHEL), CentOS, Fedora, Scientific Linux, and more, and the PostgreSQL community provides installers for these distributions.
This guide will help you get started with installing and configuring PostgreSQL for a CentOS / RHEL 7 based system, which will also work for Fedora 29.
Requirements Using systemd Multiple instance of PostgreSQL First instance running on port 5491 Second instance running on port 5492 Steps to setup first service STEP 1 create and edit service file
sudo vi /etc/systemd/system/postgresql-9.4-5941.service STEP 2 Import original and Add Env
.include /lib/systemd/system/postgresql-9.4.service [Service] Environment="PGDATA=/var/lib/pgsql/9.4/data1/" STEP 3 Modify postgresql.conf for instance
sudo vi /var/lib/pgsql/9.4/data1/postgresql.conf" STEP 4 Change port for postgresql
port=5491 Steps to setup second service STEP 1 create and edit service file