Install Postgres Advanced Server on Linux(RHEL/CentOS)


In this post, I had explained how we can install PostgreSQL on a Linux server using the source code. I also had shown ho we can automate the installation & create multiple instances. This time I am going to demonstrate how we can install Postgres Plus Advanced Server on a Linux server(RHEL/CentOS). Postgres Plus Advanced Server is an advanced version of PostgreSQL that offers many features as compared to the open source variant. You can read about it here.

Lets start with this tutorial. Please note that you will need root privileges to perform the installation.

Download the installer. First, download the installer from its official site. Make sure that you choose the installer according to your CPU architecture. You will need to create your account on that site to download it. This is a binary installer.

Unpack the tarball. Issue below commands to unpack the installer tarball. You can see a Java installer here 😉 Postgres Plus Advanced Server or PPA needs Java for some functionalities like Postgre Client (a web-based UI). So, Java has to be installed otherwise PPA will disable Java based components. I installed Java 1.8 (OpenJDK) & it installed a few dependencies as well. And when I executed the installer, it threw a “segmentation fault” error. So, I uninstalled Java & all its dependencies(that got installed alongwith Java) and then installed Java 1.7(the pre-compiled one, not using YUM since that would have installed dependencies again) & then I was able to run installer. If you face the same issue, follow what I did 😉

[root@server shashank]# ll
total 335956
-rw-rw-r-- 1 shashank shashank 160872482 Dec 9 10:22 jdk-8u25-linux-x64.tar.gz
-rw-r--r-- 1 root root 0 Dec 9 10:26 postgresql.txt
-rw-rw-r-- 1 shashank shashank 183143348 Dec 8 16:23 ppasmeta-9.4.1.3-linux-x64.tar.gz
[root@server shashank]# tar -xf ppasmeta-9.4.1.3-linux-x64.tar.gz
[root@server shashank]# ll
total 335960
-rw-rw-r-- 1 shashank shashank 160872482 Dec 9 10:22 jdk-8u25-linux-x64.tar.gz
-rw-r--r-- 1 root root 0 Dec 9 10:26 postgresql.txt
drwxrwxr-x 2 500 500 4096 Feb 10 2015 ppasmeta-9.4.1.3-linux-x64
-rw-rw-r-- 1 shashank shashank 183143348 Dec 8 16:23 ppasmeta-9.4.1.3-linux-x64.tar.gz
[root@server shashank]# cd ppasmeta-9.4.1.3-linux-x64
[root@server ppasmeta-9.4.1.3-linux-x64]# ll
total 180960
-rwxr-xr-x 1 500 500 185293474 Feb 10 2015 ppasmeta-9.4.1.3-linux-x64.run
-rw-rw-r-- 1 500 500 7836 Feb 10 2015 README_FIRST_Linux64.txt

Run the installer.

[root@server ppasmeta-9.4.1.3-linux-x64]# ./ppasmeta-9.4.1.3-linux-x64.run
Language Selection

Please select the installation language
[1] English - English
[2] Japanese - 日本語
[3] Simplified Chinese - 简体中文
[4] Traditional Chinese - 繁体中文
[5] Korean - 한국어
Please choose an option [1] : ^C

You can see I interrupted the installation 😀 Why? Because its better if we add a user called postgres without assigning any password before installing. PostgreSQL uses “postgres” user for its operation. Only “postgres” user can start/stop/restart database. So, add this is advance.

[root@psltddpdb01 ppasmeta-9.4.1.3-linux-x64]# useradd postgres
[root@psltddpdb01 ppasmeta-9.4.1.3-linux-x64]# ./ppasmeta-9.4.1.3-linux-x64.run
Language Selection

Please select the installation language
[1] English - English
[2] Japanese - 日本語
[3] Simplified Chinese - 简体中文
[4] Traditional Chinese - 繁体中文
[5] Korean - 한국어
Please choose an option [1] : 1
----------------------------------------------------------------------------
Welcome to the Postgres Plus Advanced Server Setup Wizard.

----------------------------------------------------------------------------
Please read the following License Agreement. You must accept the terms of this
agreement before continuing with the installation.

Press [Enter] to continue:
Limited Use Software License Agreement
Version 2.9

IMPORTANT - READ CAREFULLY

Press [Enter] to continue:

Do you accept this license? [y/n]: y

----------------------------------------------------------------------------
Please specify the directory where Postgres Plus Advanced Server will be
installed.

Installation Directory [/opt/PostgresPlus]: /opt/app/PostgresPlus

----------------------------------------------------------------------------
Select the components you want to install.

Database Server [Y/n] :y

Connectors [Y/n] :y

Infinite Cache [Y/n] :y

Migration Toolkit [Y/n] :y

Postgres Enterprise Manager Client [Y/n] :y

pgpool-II [Y/n] :y

pgpool-II Extensions [Y/n] :y

EDB*Plus [Y/n] :y

Slony Replication [Y/n] :y

PgBouncer [Y/n] :y

Is the selection above correct? [Y/n]: y

----------------------------------------------------------------------------
Additional Directories

Please select a directory under which to store your data.

Data Directory [/opt/app/PostgresPlus/9.4AS/data]:

Please select a directory under which to store your Write-Ahead Logs.

Write-Ahead Log (WAL) Directory [/opt/app/PostgresPlus/9.4AS/data/pg_xlog]:

----------------------------------------------------------------------------
Configuration Mode

Postgres Plus Advanced Server always installs with Oracle(R) compatibility features and maintains full PostgreSQL compliance. Select your style preference for installation defaults and samples.

The Oracle configuration will cause the use of certain objects (e.g. DATE data types, string operations, etc.) to produce Oracle compatible results, create the same Oracle sample tables, and have the database match Oracle examples used in the documentation.

Configuration Mode

[1] Oracle Compatible
[2] PostgreSQL Compatible
Please choose an option [1] : 2

----------------------------------------------------------------------------
Please provide a password for the database superuser (postgres). A locked Unix
user account (postgres) will be created if not present.

Password :
Retype Password :
----------------------------------------------------------------------------
Additional Configuration

Please select the port number the server should listen on.

Port [5432]:

Select the locale to be used by the new database cluster.

Locale

[1] [Default locale]

Please choose an option [1] :

Install sample tables and procedures. [Y/n]:
----------------------------------------------------------------------------
Dynatune Dynamic Tuning:
Server Utilization

Please select the type of server to determine the amount of system resources
that may be utilized:

[1] Development (e.g. a developer's laptop)
[2] General Purpose (e.g. a web or application server)
[3] Dedicated (a server running only Postgres Plus)
Please choose an option [2] : 3

----------------------------------------------------------------------------
Dynatune Dynamic Tuning:
Workload Profile

Please select the type of workload this server will be used for:

[1] Transaction Processing (OLTP systems)
[2] General Purpose (OLTP and reporting workloads)
[3] Reporting (Complex queries or OLAP workloads)
Please choose an option [1] : 1

----------------------------------------------------------------------------
Advanced Configuration

----------------------------------------------------------------------------
PgBouncer Listening Port [6432]:

----------------------------------------------------------------------------
Service Configuration

Autostart PgBouncer Service [Y/n]: y
Autostart pgAgent Service [Y/n]: y
Update Notification Service [Y/n]: y
The Update Notification Service informs, downloads and installs whenever
security patches and other updates are available for your Postgres Plus Advanced
Server installation.

----------------------------------------------------------------------------
Pre Installation Summary

Following settings will be used for installation:

Installation Directory: /opt/app/PostgresPlus
Data Directory: /opt/app/PostgresPlus/9.4AS/data
WAL Directory: /opt/app/PostgresPlus/9.4AS/data/pg_xlog
Database Port: 5432
Database Superuser: postgres
Operating System Account: postgres
Database Service: ppas-9.4
PgBouncer Listening Port: 6432

Press [Enter] to continue:

----------------------------------------------------------------------------
Setup is now ready to begin installing Postgres Plus Advanced Server on your
computer.

Do you want to continue? [Y/n]: y

----------------------------------------------------------------------------
Please wait while Setup installs Postgres Plus Advanced Server on your computer.

Installing Postgres Plus Advanced Server
0% ______________ 50% ______________ 100%
########################################
Installing Database Server ...
Installing pgAgent ...
Installing Connectors ...
Installing Migration Toolkit ...
Installing EDB*Plus ...
Installing Infinite Cache ...
Installing Postgres Enterprise Manager Client ...
Installing Slony Replication ...
Installing pgpool-II ...
Installing pgpool-II Extensions ...
Installing PgBouncer ...
Installing StackBuilder Plus ...
#

----------------------------------------------------------------------------
Setup has finished installing Postgres Plus Advanced Server on your computer.

Change ownership to “postgres” user on data directory.

[root@server ppasmeta-9.4.1.3-linux-x64]# chown postgres.postgres /opt/app/PostgresPlus/9.4AS/data

Switch to postgres user & login to database.

[root@server ppasmeta-9.4.1.3-linux-x64]# su - postgres
[postgres@psltddpdb01 ~]$ /opt/app/PostgresPlus/9.4AS/bin/psql -p5432
psql.bin (9.4.1.3)
Type "help" for help.

postgres=# \q

That’s all from this post 🙂 I hope this was informative & fun to read this 🙂 Thanks for visiting my blog 🙂