This document describes a potentially troublesome area in APM installations -- choosing to create a new schema for an existing Postgres installation. The solution describes the various errors that can be displayed and how to avoid them.
Scenario #1: Create Database Failed
- Status: ERROR. May see ERROR - psql: error while loading shared libraries: libssl.so.4: cannot open shared object file: No such file or directory
psql: error while loading shared libraries: libssl.so.4: cannot open shared object file: No such file or directory
- Solution: To avoid this, check that the LD_LIBRARY_PATH variable includes the Postgres lib location before running the installer
e.g. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/database/lib
Scenario #2: Create Database Failed
- Status: ERROR. May see ERROR - /home/apm/Introscope22.214.171.124_SA/install/database-scripts/unix/createdb-postgres.sh:
line 67: createlang: command not found
- Solution: To avoid this, check that the PATH variable includes the Postgres bin location before running the installer
e.g. export PATH=$PATH:/opt/database/bin
Scenario #3: The database creation fails and the schematools.log file shows errors.
- Status: ERROR: See the error - language "plpgsql" does not exist
- Solution: When running the installer, the "Create New Schema" option will only create the required plpgsql language if ALL the following conditions are met:
- the user running the installer is not root
- the APM database name does not already exist
- the APM database user does not already exist
So when creating the new schema:
- Use a new database name
- if you are retrying from a previous failed schema creation, then drop the previous schema first using dropdb-postgres.sh.
- Similarly if you a reusing a user that was also involved in a previous schema creation failure, then also delete that user first using the postgresdropuser command or specify a user that does not already exist.