This topic describes how to download and install or upgrade components of the VMware Postgres software distribution. The VMware Postgres software components are provided in 4 downloadable packages:
psql
, and the ODBC driver.psql
and the ODBC driver.root
permissions to install or upgrade the software.Perform this procedure on each host that will run VMware Postgres. Note that this process also installs the psql
and ODBC driver client components to each machine:
Download the VMware Postgres Server RPM distribution from VMware Tanzu Network. The Postgres Server download filename has the format: vmware-postgres<version>-<vmware-version>.<platform>.<architecture>.zip
, for example vmware-postgres14-14.6.0.el7.x86_64.zip.
Log in to your system as root
, or use sudo
in the next step to acquire root
privileges.
Navigate to the downloaded RPM file and install it using the yum
utility. For example:
cd ~/Downloads/vmware-postgres-14.*
yum install ./vmware-postgres14-14.6-0.el7.x86_64.rpm
The VMware Postgres RPM installation creates the postgres user and sets the PGDATA
and PATH
environment variables in ~postgres/.bash_profile
. If the .bash_profile exists prior to installation, it will not be modified. It also creates the directory /var/lib/pgsql/data
, owned by the postgres user, which you can specify for the data directory when you initialize your PostgreSQL instance. This example initializes the data directory:
su --login postgres
source ~/.bash_profile
initdb -D /var/lib/pgsql/data
If you are creating a High Availability configuration, you will initialize the Postgres instances as part of the pg_auto_failover or Patroni setup. For more details refer to Creating a High Availability cluster.
If you are creating a single non-HA Postgres server, start it by running:
postgres -D /var/lib/pgsql/data >/var/lib/pgsql/data/logfile 2>&1 &
Continue to set up and start the PostgreSQL server, as described in Server Setup and Operation in the PostgreSQL documentation.
Follow the instructions in Configuring and Using VMware Postgres to configure PostgreSQL with pgBackRest, psqlODBC, and pgjdbc.
Perform this procedure on each host that will act only as a client to the VMware Postgres instance.
Important: Do not install the client package on any machine that has a PostgreSQL server.
Download the Postgres Clients RPM distribution from VMware Tanzu Network. The download filename has the format: vmware-postgres-clients-<vmware-version>.<platform>.<architecture>.zip
, for example vmware-postgres-clients-14.6.0.el7.x86_64.zip.
Log in to your system as root
, or use sudo
in the next step to acquire root
privileges.
Navigate to the downloaded RPM file and install it using the yum
utility. For example:
cd ~/Downloads/vmware-postgres-14*
yum install ./vmware-postgres-clients-14.6-0.el7.x86_64.rpm
Download the VMware Postgres Postgres Clients for RHEL7 from VMware Tanzu Network. The JDBC driver file name inside the zip file has the format: vmware-postgres-jdbc-<jdbc-version>.jar
.
Unzip the downloaded file to obtain the driver JAR file. For example:
unzip vmware-postgres-clients-<vmware-version>-0.el7.x86_64.zip
The JDBC driver JAR is not installed at the system level; simply include it in your Java CLASSPATH
as necessary to connect using the driver. See Setting up the Class Path in the JDBC Driver documentation for more information.
The VMware Postgres Server and Extensions download from VMware Tanzu Network includes RPM packages for VMware Postgres PL/Java, VMware Postgres PL/R, Orafce, PgBouncer, and PostGIS. Follow these steps to download and install these extensions.
On the Postgres server, extract the RPM packages from the Extensions for VMware Postgres Server download file.
unzip vmware-postgres-extensions-<postgres-version>.<platform>.zip
To install the extensions see PL/Java, PL/R, and PostGIS.
Install the PL/Java extension RPM.
sudo yum install vmware-postgres<postgres-version>-pljava-extension-<pljava-version>.el7.x86_64.rpm
The following commands create the PL/JAVA extension in a Postgres database.
su postgres
psql test
#= set pljava.libjvm_location TO '/lib/jvm/jre/lib/amd64/server/libjvm.so';
#= CREATE EXTENSION pljava;
See the PL/Java project information site for information about using PL/Java.
Install R from the EPEL repo before you install the VMware Postgres PL/R RPM, so yum
can find R.
sudo yum install epel-release
Install the PL/R extension.
sudo yum install vmware-postgres<version>-plr-extension-<plr-version>.<platform>.rpm
Enable the PL/R extension in each Postgres database where it will be used. For example, these commands register the PL/R language in the database named test.
su postgres
psql -d testdb -c 'CREATE EXTENSION plr;'
See PL/R Project for more about PL/R. See The R Project for Statistical Computing for information about available R packages.
Follow these steps to install the VMware Postgres PostGIS RPM.
Install the VMware Postgres PostGIS RPM.
yum install vmware-postgres<version>-postgis-extension-<postgres-version>.<platform>.rpm
Create the PostGIS extension in each database where you want to use PostGIS.
Note: Do not install the extension in the postgres
database.
su postgres
createdb testdb
psql -d testdb -c 'CREATE EXTENSION postgis;'
See the PostGIS web site for information about using PostGIS.
Follow these steps to install the VMware Postgres Patroni RPM.
Install the VMware Postgres Patroni RPM.
yum install vmware-postgres<version>-patroni-<patroni-version>.<platform>.rpm
Use the Patroni setup page for guidance on configuration.