Chapter 15. Creating the Evergreen database

Table of Contents

Setting up the PostgreSQL server
Creating the Evergreen database and schema
Loading sample data
Creating the database on a remote server
PostgreSQL 9.1 and later

Setting up the PostgreSQL server

For production use, most libraries install the PostgreSQL database server on a dedicated machine. Therefore, by default, the Makefile.install prerequisite installer does not install the PostgreSQL 9 database server that is required by every Evergreen system. You can install the packages required by Debian or Ubuntu on the machine of your choice using the following commands as the root Linux account:

(Debian / Ubuntu / Fedora) Installing PostgreSQL server packages. Each OS build target provides the postgres server installation packages required for each operating system. To install Postgres server packages, use the make target postgres-server-<OSTYPE>. Choose the most appropriate command below based on your operating system.

make -f Open-ILS/src/extras/Makefile.install postgres-server-debian-jessie
make -f Open-ILS/src/extras/Makefile.install postgres-server-debian-wheezy
make -f Open-ILS/src/extras/Makefile.install postgres-server-ubuntu-trusty
make -f Open-ILS/src/extras/Makefile.install postgres-server-ubuntu-xenial
make -f Open-ILS/src/extras/Makefile.install postgres-server-fedora

(Fedora) Postgres initialization. Installing Postgres on Fedora also requires you to initialize the PostgreSQL cluster and start the service. Issue the following commands as the root user:

postgresql-setup initdb
systemctl start postgresql

For a standalone PostgreSQL server, install the following Perl modules for your distribution as the root Linux account:

(Debian Wheezy, Ubuntu Trusty, and Ubuntu Xenial). No extra modules required for these distributions.

(Fedora). 

cpan Rose::URI

You need to create a PostgreSQL superuser to create and access the database. Issue the following command as the postgres Linux account to create a new PostgreSQL superuser named evergreen. When prompted, enter the new user’s password:

createuser -s -P evergreen

Enabling connections to the PostgreSQL database. Your PostgreSQL database may be configured by default to prevent connections, for example, it might reject attempts to connect via TCP/IP or from other servers. To enable TCP/IP connections from localhost, check your pg_hba.conf file, found in the /etc/postgresql/ directory on Debian and Ubuntu, and in the /var/lib/pgsql/data/ directory on Fedora. A simple way to enable TCP/IP connections from localhost to all databases with password authentication, which would be suitable for a test install of Evergreen on a single server, is to ensure the file contains the following entries before any "host … ident" entries:

host    all             all             ::1/128                 md5
host    all             all             127.0.0.1/32            md5

When you change the pg_hba.conf file, you will need to reload PostgreSQL to make the changes take effect. For more information on configuring connectivity to PostgreSQL, see http://www.postgresql.org/docs/devel/static/auth-pg-hba-conf.html