cancel
Showing results for 
Search instead for 
Did you mean: 

PostGIS Quickstart EPAS 10 on RHEL/CentOS 7

EDB Team Member

Objective

Quickly (less than five minutes) install and run a default EPAS 10 cluster on RHEL/CentOS 7 with PostGIS installed and configured

 

Prerequisites

Running instance of RHEL/CentOS 7 with root access

 

Components

There are three primary components to getting PostGIS running:

  1. EPAS 10 Installation

  2. EPAS 10 PostGIS Installation

    1. Depends on EDB Tools repository
    2. Depends on EPEL repository
  3. Enable PostGIS extensions in the desired database

 

Steps (as root user)

##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
#
export YUM_USER= #####Please provide your username for the edb yum repo
export YUM_PASSWORD=  ###Please provide your password for the edb yum repo


##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
#

sed -i "s/<username>:<password>/$YUM_USER:$YUM_PASSWORD/g" /etc/yum.repos.d/edb.repo
sed -i "\/edbas10/,/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 10
#
#yum install -y edb-as10-server-core ##if you want to install just the core-database
yum install -y edb-as10-server
#EDB PostGIS install package
yum install -y edb-as10-postgis


# Start the EPAS server and initialize a new Postgres
# data directory using the appropriate mechanism
# for the operating system
#
if [ `cat /etc/redhat-release | grep "release 7" | wc -l` = 1 ]
then
/usr/edb/as10/bin/edb-as-10-setup initdb
su - enterprisedb -c "sed -i \"s/ident/md5/g\" /var/lib/edb/as10/data/pg_hba.conf" \
&& echo "host all all 0.0.0.0/0 md5" >>/var/lib/edb/as10/data/pg_hba.conf
su - enterprisedb -c "psql -d edb -c 'alter user enterprisedb identified by enterprisedb'"
systemctl start edb-as-10
elif [ `cat /etc/redhat-release | grep "release 6" | wc -l` = 1 ]
then
service edb-as-10 initdb
su - enterprisedb -c "sed -i \"s/ident/md5/g\" /var/lib/edb/as10/data/pg_hba.conf" \
&& echo "host all all 0.0.0.0/0 md5" >>/var/lib/edb/as10/data/pg_hba.conf
su - enterprisedb -c "psql -d edb -c 'alter user enterprisedb identified by enterprisedb'"
service edb-as-10 start
fi


su - enterprisedb -c "psql -d edb -c 'alter user enterprisedb identified by enterprisedb'"

su - enterprisedb
/usr/edb/as10/bin/psql -d edb
select version();
select * from dual;

CREATE EXTENSION postgis;
CREATE EXTENSION postgis_topology;
CREATE TABLE updown (name TEXT, point GEOMETRY);
INSERT INTO updown VALUES ('UP', 'POINT(0 1)') , ('DOWN', 'POINT(0 -1)');
SELECT name, ST_AsText(point) FROM updown;
EXIT

#
# Congratulations! You have successfully installed, configured, and used PostGIS!
#

#

Tips

 

Summary

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

 

Please send questions/comments to sales@enterprisedb.com