View Source

{section}
{column}
h1. Introduction

Petals ESB is provided with an embeded HSQL database system. This database is currently used to persist registry-related datas and will be used in future versions to persist topology, messages, ...

While HSQLDB is suitable for light installations (a few endpoints, light to medium trafic), for heavy production use, you should consider using a more robust database system.

This documentation will guide you to the installation and configuration of MySQL, but Petals ESB has also been tested with PosgreSQL and Oracle database management systems.

h1. MySQL installation & configuration

h2. MySQL installation

First you may need to install MySQL on your computer. To do so, you can either use this quick tutorial or refer to the MySQL documentation.

h3. Ubuntu Linux

The following steps will guide you through the installation of Ubuntu systems :

* Install MySQL :
{noformat}
sudo apt-get install mysql-server mysql-admin
{noformat}

This will install the default MySQL version for your Ubuntu server.


You may also read the following documentation for further informations : http://doc.ubuntu-fr.org/mysql .

h3. RedHat / Fedora Linux

The following steps will guide you through the installation of MySQL on RedHat / Fedora systems :

* Install MySQL :
{noformat}
# yum install mysql-server mysql
{noformat}
* Launch MySQL
{noformat}
/etc/init.d/mysql start
{noformat}
* Change the default password :
{noformat}
mysqladmin -u root password petals
{noformat}
* Test database connectivity :
{noformat}
mysql -u root -p
{noformat}
* Clean up the installation :
{noformat}
mysql> drop database test;
{noformat}

h3. Windows Systems

todo

h2. MySQL use

This chapter will give you some basic commands to launch, stop, reload MySQL. For more advanced documentation, feel free to check the [MySQL website|http://www.mysql.com/].

h3. Linux systems

Checking the MySQL status :
{noformat}
/etc/init.d/mysqld status
{noformat}

Launch MySQL
{noformat}
/etc/init.d/mysql start
{noformat}

Stop MySQL
{noformat}
/etc/init.d/mysql stop
{noformat}

Restart MySQL
{noformat}
/etc/init.d/mysql restart
{noformat}

Reload MySQL configuration
{noformat}
/etc/init.d/mysql reload
{noformat}

Force-Reload MySQL configuration
{noformat}
/etc/init.d/mysql force-reload
{noformat}

h3. Windows Systems

todo

h2. Configuring MySQL character set

By default, Petals ESB uses the UTF8 character set, which is not the default character set of MySQL. This chapter will help you to configure MySQL to use this character set.

h3. Linux systems

* Add the following to lines at the end of the section "{{\[mysqld]}}" of the file */etc/my.cnf* (copy */usr/share/mysql/my-huge.cnf* dans */etc/my.cnf*)
{noformat}
character-set-server=utf8
skip-character-set-client-handshake
{noformat}
* Restart MySQL :
{noformat}
/etc/init.d/mysql restart
{noformat}
* Open a new connection to MySQL :
{noformat}
mysql -u root -p
{noformat}
* Execute the following command :
{noformat}
SHOW VARIABLES LIKE 'char%';
{noformat}
* Check if it's result looks like this :
{noformat}
mysqld> SHOW VARIABLES LIKE 'char%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysqld/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)
{noformat}
* Done :)

h3. Windows Systems

todo

h2. Creating & configuring a new database

* Open a new connection to MySQL :
{noformat}
mysql -u root -p
{noformat}
* Create a new database for Petals :
{noformat}
mysql> create database petals;
{noformat}
* Check whether or not the database has been successfully created you can execute the following command :
{noformat}
mysql> show databases;
{noformat}
* Create a new user to write to the newly created database :
{noformat}
mysql> create user "petals"@"localhost";
mysql> set password for "petals"@"localhost" = password("petals");
{noformat}
* Set up the permissions for this user, so that he can read and write datas to the newly created database :
{noformat}
mysql> grant all on petals.* to petals@localhost;
mysql> exit
{noformat}
* Check if this user can open a new connection to this database :
{noformat}
mysql -u petals -p
mysql> connect petalsRegistry;
mysql> exit
{noformat}
* Done :)

h2. Petals ESB configuration

todo

h2. Testing the installation

todo


h1. PostgreSQL installation & configuration

h2. PostgreSQL installation

h3. Ubuntu Linux

* Install PostgreSQL
{noformat}
sudo apt-get install openssl openssl-blacklist postgresql postgresql-client-common postgresql-common ssl-cert
{noformat}

h2. PostgreSQL configuration

todo

{column}
{column:width=350px}
{panel:title=Table of contents}{toc}{panel}
{panel:title=Contributors}{contributors:order=name|mode=list}{panel}
{column}



{section}