Installation of EDB Postgres Advanced Server on custom path

Mohini Ogale
Mohini Ogale

The process described in the following article is not recommended/advised for use in production environment as these can have undesirable affects like update process failing to find relevant binaries. The process should only be used for testing environments where you might need multiple versions of a product running at the same time.

When installing EPAS using yum install edb-asxx-server, the default installation location is `/usr/edb/asxx/'. Due to restrictions in secure environments, or due to some policies, sometimes it is required to install EPAS on a no-default path.

In order to achieve that, we can use linux command rpm2cpio which converts the .rpm file specified as a single argument to a .cpio archive on standard out. It only extracts the file contents and not actually installs it.

For example, if you provide the pwd as /epas14, then rpm2cpio will extract the contents of RPM inside the directory like /epas14/usr/edb/as14/.

Below are the high level steps for installing EPAS on custom path:

Step 1:

Download the required RPMs from here

Step 2:

Please copy the RPMs to your target directory. Also, make pwd your target directory for binary location:

[root@localhost as14]# pwd
/tmp/as14

Run the below commands for RPMs:

rpm2cpio edb-as14-server-libs-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-client-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-contrib-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-libicu66-66.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-sslutils-1.3-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-sqlprotect-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-sqlprofiler-4.0-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-pltcl-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-plpython3-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-plperl-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-parallel-clone-1.9-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-indexadvisor-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-docs-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-cloneschema-1.16-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-llvmjit-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-core-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv
rpm2cpio edb-as14-server-devel-14.2.1-1.rhel7.x86_64.rpm | cpio -idmv

Step 3:

The installation will create below directories under target directory:

[root@localhost as14]# pwd
/tmp/as14
drwxr-xr-x. 3 root root 25 Mar 8 19:24 etc
drwxr-xr-x. 4 root root 30 Mar 8 19:24 usr
drwxr-xr-x. 3 root root 16 Mar 8 19:36 var

Step 4:

Initialize the database server on the desired data directory:

[enterprisedb@localhost ~]$ /tmp/as14/usr/edb/as14/bin/initdb -D /tmp/as14/var/lib/edb/as14/data
The files belonging to this database system will be owned by user "enterprisedb".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /tmp/as14/var/lib/edb/as14/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... America/Los_Angeles
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
creating edb sys ... ok
loading edb contrib modules ...
edb_redwood_bytea.sql 
edb_redwood_date.sql 
dbms_alert_public.sql 
dbms_alert.plb 
dbms_job_public.sql 
dbms_job.plb 
dbms_lob_public.sql 
dbms_lob.plb 
dbms_output_public.sql 
dbms_output.plb 
dbms_pipe_public.sql 
dbms_pipe.plb 
dbms_rls_public.sql 
dbms_rls.plb 
dbms_sql_public.sql 
dbms_sql.plb 
dbms_utility_public.sql 
dbms_utility.plb 
dbms_aqadm_public.sql 
dbms_aqadm.plb 
dbms_aq_public.sql 
dbms_aq.plb 
dbms_profiler_public.sql 
dbms_profiler.plb 
dbms_random_public.sql 
dbms_random.plb 
dbms_redact_public.sql 
dbms_redact.plb 
dbms_lock_public.sql 
dbms_lock.plb 
dbms_scheduler_public.sql 
dbms_scheduler.plb 
dbms_crypto_public.sql 
dbms_crypto.plb 
dbms_mview_public.sql 
dbms_mview.plb 
dbms_session_public.sql 
dbms_session.plb 
edb_bulkload.sql 
edb_gen.sql 
edb_objects.sql 
edb_redwood_casts.sql 
edb_redwood_strings.sql 
edb_redwood_views.sql 
utl_encode_public.sql 
utl_encode.plb 
utl_http_public.sql 
utl_http.plb 
utl_file.plb 
utl_tcp_public.sql 
utl_tcp.plb 
utl_smtp_public.sql 
utl_smtp.plb 
utl_mail_public.sql 
utl_mail.plb 
utl_url_public.sql 
utl_url.plb 
utl_raw_public.sql 
utl_raw.plb 
commoncriteria.sql 
edb_gen_redwood.sql 
waitstates.sql 
installing extension edb_dblink_libpq ... ok
installing extension edb_dblink_oci ... ok
snap_tables.sql 
snap_functions.sql 
dblink_ora.sql 
sys_stats.sql 
ok
finalizing initial databases ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

/tmp/as14/usr/edb/as14/bin/pg_ctl -D /tmp/as14/var/lib/edb/as14/data -l logfile start

Errors and troubleshooting

  1. You might get the below error due to missing library on default location. This was resolved after setting LD_LIBRARY_PATH.
[enterprisedb@localhost ~]$ /tmp/as14/usr/edb/as14/bin/initdb -D /tmp/as14/var/lib/edb/as14/data /tmp/as14/usr/edb/as14/bin/edb-postgres: **error while loading shared libraries: libicui18n.so.66: cannot open shared object file: No such file or directory no data was returned by command ""/tmp/as14/usr/edb/as14/bin/edb-postgres" -V" initdb: error: The program "edb-postgres" is needed by initdb but was not found in the same directory as "/tmp/as14/usr/edb/as14/bin/initdb". Check your installation.**

Workaround:

[enterprisedb@localhost ~]$ export LD_LIBRARY_PATH=/tmp/as14/usr/libexec/edb-icu66/lib/
  1. Permission denied for data directory
[enterprisedb@localhost ~]$ /tmp/as14/usr/edb/as14/bin/initdb -D /tmp/as14/var/lib/edb/as14/data
The files belonging to this database system will be owned by user "enterprisedb".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

initdb: error: could not access directory "/tmp/as14/var/lib/edb/as14/data": Permission denied

Workaround:

[root@localhost lib]# pwd
/tmp/as14/var/lib
[root@localhost lib]# chown -R enterprisedb:enterprisedb edb

Was this article helpful?

0 out of 0 found this helpful