Installing and running EDB Postgres Advanced Server cluster on RHEL 6 or RHEL 7

Postgres Installation

Haris Iftikhar  Sales Engineer

Objective

Quickly (less than five minutes) install and run a default EPAS 11 cluster on RHEL 6 or RHEL 7

 

Prerequisites

Running instance of RHEL/CentOS 6/7 with root access

 

Components

There are three primary components to EPAS:

EPAS 11 Installation (/var/lib/edb/as11/)

EPAS 11 Cluster Directories (user configurable, but defaults to /var/lib/edb/as11/data)

pg_hba.conf - Postgres Host Based Access file specifices who can connect to the cluster
postgresql.conf - Postgres main configuration file with all other configuration settings for the cluster

# # Congratulations! You have successfully installed, configured, and connected to your first EPAS 11 cluster.

##Here is a quick, complete example for installing EDB Postgres v10 on RHEL/CentOS 6/7:

#
# Install the new EDB Repo
#
yum install -y http://yum.enterprisedb.com/edbrepos/edb-repo-latest.noarch.rpm
yum install -y epel-release
#
# Configure the edb.repo username/password
#

#
# Enable EPAS 10, dependencies, and tools repositories
#
# Configure the edb.repo username/password
#

#
# Enable EPAS 10, dependencies, and tools repositories
#
export YUM_USER= #####Please provide your username for the edb yum repo
export YUM_PASSWORD=  ###Please provide your password for the edb yum repo

# Configure the edb.repo username/password
#
#
# Enable EPAS 10, dependencies, and tools repositories
#

sed -i "s/<username>:<password>/$YUM_USER:$YUM_PASSWORD/g" /etc/yum.repos.d/edb.repo
sed -i "\/edbas11/,/gpgcheck/ s/enabled=0/enabled=1/" /etc/yum.repos.d/edb.repo
sed -i "\/enterprisedb-dependencies/,/gpgcheck/ s/enabled=0/enabled=1/" /etc/yum.repos.d/edb.repo
sed -i "\/enterprisedb-tools/,/gpgcheck/ s/enabled=0/enabled=1/" /etc/yum.repos.d/edb.repo
#

# Install EPAS 11
#
#yum install -y edb-as11-server-core ##if you want to install just the core-database
yum install -y edb-as11-server

if [ `cat /etc/redhat-release | grep "release 7" | wc -l` = 1 ]
then
/usr/edb/as11/bin/edb-as-11-setup initdb
su - enterprisedb -c "sed -i \"s/ident/md5/g\" /var/lib/edb/as11/data/pg_hba.conf" \
&& echo "host all all 0.0.0.0/0 md5" >>/var/lib/edb/as11/data/pg_hba.conf
systemctl start edb-as-11
su - enterprisedb -c "/usr/edb/as11/bin/psql -d edb -c 'alter user enterprisedb identified by enterprisedb'"
elif [ `cat /etc/redhat-release | grep "release 6" | wc -l` = 1 ]
then
service edb-as-11 initdb
su - enterprisedb -c "sed -i \"s/ident/md5/g\" /var/lib/edb/as11/data/pg_hba.conf" \
&& echo "host all all 0.0.0.0/0 md5" >>/var/lib/edb/as11/data/pg_hba.conf
su - enterprisedb -c "psql -d edb -c 'alter user enterprisedb identified by enterprisedb'"
service edb-as-11 start
fi


su - enterprisedb
psql -d edb
select version();
select * from dual;
exit
exit

 

Summary

This guide is intended to get you up and started with a default installation of EPAS 11 as quickly as possible.  This is just the beginning though.  Please stay tuned for more tutorials and demos of specific features available in EPAS 11

Haris Iftikhar Sales Engineer