cancel
Showing results for 
Search instead for 
Did you mean: 

PostGIS Quickstart EPAS 9.5 on RHEL/CentOS 7

Community Manager

Objective

Quickly (less than five minutes) install and run a default EPAS 9.5 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 9.5 Installation

  2. EPAS 9.5 PostGIS Installation

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

 

Steps (as root user)

#!/bin/bash

#
# Setup YUM repository for installing EPAS 
#
rpm -Uvh http://yum.enterprisedb.com/edbrepos/edb-repo-9.6-4.noarch.rpm

#
# Set YUM username/password in edb.repo
#
export YUM_USER=<yum user>
export YUM_PASSWORD=<yum password>
sed -i "s/<username>:<password>/$YUM_USER:$YUM_PASSWORD/g" /etc/yum.repos.d/edb.repo

#
# Enable the EPAS 9.5 repo in edb.repo
#
sed -i "\/ppas95/,/gpgcheck/ s/enabled=0/enabled=1/" /etc/yum.repos.d/edb.repo

#
# Install EPAS 9.5
#
yum -y install ppas95-server

#
# Enable the EDB Tools repository (needed for JDBC libraries) and the EPEL repository (several libraries 
# needed by PostGIS)
#
sed -i "\/enterprisedb-tools/,/gpgcheck/ s/enabled=0/enabled=1/" /etc/yum.repos.d/edb.repo
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

#
# Install PostGIS
#
yum -y install ppas95-postgis

#
# Create a default cluster
#
su - enterprisedb -c "/usr/ppas-9.5/bin/initdb -D /var/lib/ppas/9.5/data"

#
# Start the default cluster
#
su - enterprisedb -c "/usr/ppas-9.5/bin/pg_ctl -wD /var/lib/ppas/9.5/data start"

#
# Connect to the default database, create the PostGIS extensions, create a spatially enabled table,
# insert into the table, and select from the table
#
su - enterprisedb -c "/usr/ppas-9.5/bin/psql -p 5444 -d edb -U enterprisedb"
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 9.5 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 9.5 and PostGIS.

 

Please send questions/comments to sales@enterprisedb.com