These instructions will help you connect BellaDati to a PostgreSQL 8.4+ database. It is intended for BellaDati WAR installations.
Before You Begin
Are You Migrating BellaDati to Another Server?
If you are migrating BellaDati to another server, create an export of your data as an XML backup. You will then be able to transfer data from your old database to your new database.
On this page:
Create and Configure the PostgreSQL Database
- Create a database user which BellaDati will connect as (e.g.
belladati_dbuser
). Remember this database user name, as it will be used to configure BellaDati's connection to this database in subsequent steps. Do not forget to configure thepg_hba.conf
file, which controls the database access.
$ createuser -SDRP belladati_dbuser
- Create a database for BellaDati to be used as data warehouse (e.g.
belladati_db
) with Unicode collation.
Or from the command-line:CREATE DATABASE belladati_db WITH ENCODING 'UNICODE';
$ createdb -E UNICODE -O belladati_dbuser belladati_db
- Ensure that the user has permissions to connect to the database, and to create and write to tables in the database.
- Check if your database has the plpgsql language, if not, you can define it using this command:
Or from the command-line:CREATE LANGUAGE plpgsql
$ createlang -U belladati_dbuser plpgsql belladati_db
When using default PostgreSQL configuration file pg_hba.conf
, you have to execute this command by connecting via TCP socket:
createlang -h 127.0.0.1 -U belladati_dbuser plpgsql belladati_db
Remember this database name, as it will be used to configure BellaDati's connection to this database in subsequent steps.
Copy the PostgreSQL JDBC Driver to Your Application Server
Skip this step if you are using BellaDati virtual applicance distribution. BellaDati virtual appliance includes the PostgreSQL JDBC driver.
- Download the PostgreSQL JDBC driver from http://jdbc.postgresql.org/download.html. (Obtain version 9.0 of the JDBC 4 driver.)
- Add the PostgreSQL JDBC driver jar to the
lib/
directory of your application server.
PostgreSQL configuration
We are strongly recommending to perform the following PostgreSQL configuration changes in $POSTGRES_HOME/data/postgresql.conf
. This example specifies parameters when you are running BellaDati and database on a single server with 4GB memory. 2GB of the are allocated for BellaDati application server running on JAVA (the -Xmx parameter). The rest should be available for operating system and database server.
Name |
Value |
Note |
---|---|---|
max_connections |
100 |
|
shared_buffers |
512MB |
min 1/4 RAM |
temp_buffers |
2MB |
per session |
work_mem |
10MB |
per client connection |
maintenance_work_mem |
64MB |
|
max_stack_depth |
2MB |
|
wal_buffers |
128kB |
|
effective_cache_size |
512MB |
|
PostgreSQL connection parameters for GlassFish
|
The database user, which BellaDati uses for establishing the database connection |
|
Database user password |
|
Server name or IP address of the machine, where the database is running |
|
The database name |
Do not forget to configure your PostgreSQL database instance's pg_hba.conf
and postgresql.conf
files for allowing incomming connections for desired user and database name.
Next steps
Continue configuring BellaDati WAR for your application server as described on: