Installing PostgreSQL

Learn how to install a PostgreSQL external database for use with NiFi Registry.

If you have already installed a MySQL database, you may skip these steps. Both databases are not required.

For a list of supported PostgreSQL databases, see Supported NiFi Registry databases.

You have installed the JDK. For details, see Installing the JDK.
  1. Install Red Hat Package Manager (RPM) according to the requirements of your operating system:
    yum install https://yum.postgresql.org/[***POSTGRESQL_VERSION***]/redhat/rhel-[***RHEL_VERSION***]-x86_64/[***REPOSITORY_PACKAGE_NAME***]

    You can replace the placeholders with the appropriate values for your specific use case:

    • [***POSTGRESQL_VERSION***]: Replace this with the desired PostgreSQL version.
    • [***RHEL_VERSION***]: Replace this with the Red Hat Enterprise Linux (RHEL) version you are using.
    • [***REPOSITORY_PACKAGE_NAME***]: Replace this with the name of the repository configuration package for the specific PostgreSQL version and RHEL version you are targeting.
    For example, if you want edto add the PostgreSQL 12 repository to a RHEL 8 system, you would use:
    yum install https://yum.postgresql.org/12/redhat/rhel-8-x86_64/pgdg-redhat12-12-4.noarch.rpm
  2. Install the PostgresSQL version of your choice:
    yum install postgresql[***POSTGRESQL_VERSION***]-server postgresql[***POSTGRESQL_VERSION***]-contrib postgresql[***POSTGRESQL_VERSION***]
    For example, if you wanted to add the PostgreSQL 12, you would use:
    yum install postgresql12-server postgresql12-contrib postgresql12
  3. Initialize the database.
    For CentOS 7, use the following syntax:
    [***POSTGRESQL_BIN_PATH***]/postgresql[***POSTGRESQL_VERSION***]-setup initdb
    
    For example, if you wanted to initalize PostgreSQL 12, you would use:
    /usr/pgsql-12/bin/postgresql12-setup initdb
  4. Start PostgresSQL.
    systemctl enable postgresql-[***POSTGRESQL_VERSION***].service
    systemctl start postgresql-[***POSTGRESQL_VERSION***].service
    For example, if you are using CentOS 7, use the following syntax:
    systemctl enable postgresql-12.service
    systemctl start postgresql-12.service
  5. Verify that you can log in:
    sudo su postgres
    psql

Once you have installed PostgreSQL, configure the database for use with NiFi Registry.