Page History
Section | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
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.Code Block $ 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:Code Block CREATE DATABASE belladati_db WITH ENCODING 'UNICODE' TEMPLATE template0;
Code Block $ createdb -E UNICODE -O belladati_dbuser belladati_db -T template0
- 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:Code Block CREATE LANGUAGE plpgsql
Code Block $ createlang -U belladati_dbuser plpgsql belladati_db
Note |
---|
When using the default PostgreSQL configuration file |
Info |
---|
Remember the database name; it will be used to configure BellaDati's connection to the database in subsequent steps. |
PostgreSQL configuration
We strongly recommend performing the following PostgreSQL configuration changes in $POSTGRES_HOME/data/postgresql.conf
. This example specifies parameters when you run the BellaDati application and database on a single server with 4GB memory. 2GB are allocated for the BellaDati application server running on Java (using the -Xmx parameter). The rest should be available for the operating system and database server.
Name | Value | Note |
---|---|---|
max_connections | 50 |
|
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 | 512kB |
|
effective_cache_size | 512MB |
|
log_statement | none |
|
Info |
---|
We recommend set the |
Backup and restore
You can backup the BellaDati database using the PostgreSQL dump command:
Code Block |
---|
pg_dump -U user -F c -v -f "path_to_dump/dump.backup" belladati_db |
To restore a backup, use the pg_restore
command:
Code Block |
---|
pg_restore -v -c -O -d belladati_db -U user path_to_dump/dump.backup |
Next steps
Continue installing the BellaDati WAR on your application server as described in: