Installing Postgres
Install Postgres 12 on RHEL 7 and Ubuntu 18.
Postgres 12 is Required
Starting with Tamr 2020.012, Tamr requires Postgres 12. Before upgrading to Tamr 2020.012, you must upgrade your instance of Postgres to version 12. Earlier versions of Postgres are not supported beginning with Tamr 2020.012. For more information, see Upgrading Postgres.
Since Postgres 10, Postgress versioning has changed. Postgres 12 denotes a major version of Postgres required by Tamr. Minor releases of Postgress contain only bug and security fixes and are fully compatible with each other. We recommend that you install or upgrade to the latest available minor version of Postgres 12.
Pointing Tamr to an Installed Postgres Instance
If you already have Postgres installed in your environment, you can point Tamr to it. For more information, see Configuring Postgres.
Installing Postgres 12 on RHEL 7
Before you begin, check the following:
- Current user is the Tamr functional user, such as
tamr
. - The
yum
package manager software is available. - Outgoing connection to the Internet exists.
These PostgreSQL 12 installation instructions are based on the procedure described in the RHEL YUM PostgreSQL Repository, which maintains the PostgreSQL packages for RHEL.
To install Postgres 12 on RHEL 7:
- Stop Tamr and its dependencies. See Restarting.
- Confirm that the environment variable
LANG
is set toen_US.UTF-8
.
sudo echo $LANG
- Install the repository RPM.
sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
- Install the PostgreSQL server:
sudo yum install postgresql12-server
- Initialize the database:
sudo /usr/pgsql-12/bin/postgresql-12-setup initdb
- Enable the automatic start of the Postgres service.
sudo systemctl enable postgresql-12
sudo systemctl start postgresql-12
- Optional. Configure a non-default location for
PGDATA
. We recommend placingPGDATA
in the same directory where the Tamr software package is installed. The size ofPGDATA
can be around 1GB, because Tamr stores only limited amount of data in this directory. See also Configuring a non-default value for PGDATA. - Enable password authentication. Edit the Postgres configuration file
${PGDATA}/pg_hba.conf
to change the settings for IPv4 and IPv6 local connections as follows, and save the file.
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 trust
- Restart the database.
sudo systemctl start postgresql-12.service
- Optional. Change the Postgres user's password and encrypt that password. For information, see Postgres Configuration.
- Start Tamr and its dependencies. See Restarting.
Configuring a Non-Default Value for PGDATA
on RHEL 7
PGDATA
on RHEL 7The default value for PGDATA on RHEL is /var/lib/pgsql/12/data. You can change it to a different value by soft linking the directory.
To configure a non-default value for PGDATA via a soft-link
Before you begin, check that you have installed Postgres and it is not running.
- Create a non-default directory for
PGDATA
, such as/data/pgdata
, and change its user and group topostgres
.
sudo mkdir /data/pgdata
sudo chown postgres:postgres /data/pgdata
- Ensure the required permissions on the directory.
sudo chmod -R 0700 /data/pgdata
- As the user
postgres
, change to the directory/var/lib/pgsql/12/data
and copy all files within to the directory/data/pgdata
.
sudo cd /var/lib/pgsql/12/data
cp -R * /data/pgdata
- As the user
postgres
, remove the directory/var/lib/pgsql/12/data
and create a soft link to the directory/data/pgdata
.
sudo rm -rf /var/lib/pgsql/12/data
ln -s /data/pgdata /var/lib/pgsql/12/data
Installing Postgres 12 on Ubuntu 18
Important: Ubuntu 18.04 reached End of Standard Support in June 2023. See Notice for Ubuntu for recommended steps.
These PostgreSQL 12 installation instructions are based on instructions from the PostgreSQL API Repository, or APT
, which maintains the PostgreSQL Global Development Group (PGDG) packages.
Before you begin, check the following:
- Current user is the Tamr functional user, such as
tamr
. - The command line tool for managing packages, Advanced Packaging Tool (APT), or
apt-get
, is available. - Outgoing connection to the Internet exists.
To install Postgres 12 on Ubuntu 18:
- Stop Tamr and its dependencies. See Restarting.
- Confirm the environment variable
LANG
is set toen_US.UTF-8
.
sudo echo $LANG
- Add the path of the Debian distribution repository for Postgres to the end of the file
/etc/apt/sources.list.d/pgdg.list
, creating it if it doesn't exist.
sudo sh -c "echo 'deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main' >> /etc/apt/sources.list.d/pgdg.list"
- Import the repository signing key, and update the package lists.
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
- Install Postgres. Postgres is installed in the following directories:
/usr/lib/postgresql/12/bin
,/var/lib/postgresql/12
,/etc/postgresql/12/main
.
sudo apt-get install postgresql-12 postgresql-client-12 -y --no-install-recommends
- Edit the Postgres configuration file
pg_hba.conf
located in/etc/postgresql/12/main
to verify that peer authentication is enabled. Use an editor to change the settings for IPv4 and IPv6 local connections as follows, and save the file.
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 trust
- Restart the Postgres service.
sudo service postgresql start
- Optional. Configure a non-default location for
PGDATA
. We recommend placingPGDATA
in the same directory where the Tamr software package is installed. The size ofPGDATA
can be around 1GB, because Tamr stores only limited amount of data in this directory. For more information about settingPGDATA
, see the following section on this page. - Optional. Change the Postgres user's password and encrypt that password. For information, see Postgres Configuration.
- Start Tamr and its dependencies. See Restarting.
Configuring a Non-Default Value for PGDATA on Ubuntu
The default value of PGDATA
on Ubuntu is /var/lib/postgresql/12/main
.
Before you begin, check that you have installed Postgres and it is not running.
To configure a non-default value for PGDATA
on Ubuntu:
- Create a non-default directory for
PGDATA
, such as/data/pgdata
, and change its user and group topostgres
.
sudo mkdir /data/pgdata
sudo chown postgres:postgres /data/pgdata
- Ensure the required permissions on the directory.
sudo chmod -R 0700 /data/pgdata
- As the user
postgres
, change to the directory/var/lib/postgresql/12/main
and copy all files within to the directory/data/pgdata
.
cd /var/lib/postgresql/12/main
cp -R * /data/pgdata
- As the user
postgres
, remove the directory/var/lib/postgresql/12/main
and create a soft link to the directory/data/pgdata
.
rm -rf /var/lib/postgresql/12/main
ln -s /data/pgdata /var/lib/postgresql/12/main
Updated over 1 year ago