Database Setup

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.

MySQL installation & configuration

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.

Ubuntu Linux

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

  • Install MySQL :
    sudo apt-get install mysql-server mysql-admin
    

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 .

RedHat / Fedora Linux

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

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

Windows Systems

todo

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.

Linux systems

Checking the MySQL status :

/etc/init.d/mysqld status

Launch MySQL

/etc/init.d/mysql start

Stop MySQL

/etc/init.d/mysql stop

Restart MySQL

/etc/init.d/mysql restart

Reload MySQL configuration

/etc/init.d/mysql reload

Force-Reload MySQL configuration

/etc/init.d/mysql force-reload

Windows Systems

todo

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.

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)
    character-set-server=utf8
    skip-character-set-client-handshake
    
  • Restart MySQL :
    /etc/init.d/mysql restart
    
  • Open a new connection to MySQL :
    mysql -u root -p
    
  • Execute the following command :
    SHOW VARIABLES LIKE 'char%';
    
  • Check if it's result looks like this :
    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)
    
  • Done

Windows Systems

todo

Creating & configuring a new database

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

Petals ESB configuration

todo

Testing the installation

todo

PostgreSQL installation & configuration

PostgreSQL installation

Ubuntu Linux

  • Install PostgreSQL
    sudo apt-get install openssl openssl-blacklist postgresql postgresql-client-common postgresql-common ssl-cert
    

PostgreSQL configuration

todo

Contributors
No contributors found for: authors on selected page(s)
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.