The Akula Server requires a database to store the configuration and run time information used by the server. The Akula Server includes an internal Apache Derby database that you can use to get up and running quickly in a development environment.
While the Derby database is adequate for development work, it is not intended to function in a deployment environment. For deployment, Verivo recommends that you configure the Akula Server to use an external enterprise-class databases, such as Microsoft SQL Server, MySQL, and Oracle.
In your deployment environment, you might want multiple Akula Servers running on different machines to share configuration and run time information. Therefore, you can configure multiple Akula Servers to reference a single, shared database.
This contains the following sections:
The Akula Server supports connections to JDBC-compliant databases. Example databases that have been tested with the Akula Server include:
- SQL Server 2008, 2012
- MySQL 5 InnoDB
- Oracle 11g
However, any database that supports JDBC should work with the Akula Server.
Additionally, the Akula Server uses Hibernate to communicate with the database. Therefore, your database should have a corresponding Hibernate dialect class. For examples of Hibernate dialect classes, see http://docs.jboss.org/hibernate/orm/3.5/api/org/hibernate/dialect/class-use/Dialect.html#org.hibernate.dialect.
Use the internal Apache Derby database
Copy the following settings into the
AKULA_HOME/global/context.properties file, overwriting any other settings, to configure the Akula Server to reference the internal Derby database, then restart the Akula Server:
Use an external database
For deployment, Verivo recommends that you configure the Akula Server to use an external enterprise-class databases, such as Microsoft SQL Server, MySQL, and Oracle. This section describes how to configure the Akula Server to access the database.
Configuring an external database is a three step procedure:
- Create the external database on Microsoft SQL Server, MySQL, or Oracle.
- Configure an Akula Server to reference the external database.
- Start the akula.war file. If this is the first time the Akula Server has connected to the database, the akula.war automatically initializes the database with the necessary tables and table schemas.
Step 1: Creating the external database for use by the Akula Server
Before an Akula Server can connect to an external database, the database must exist.
To create the database:
Create a new database for use by the Akula Server. For example, create a database named akuladb.
You do not have to create any tables in the database. On start up, the akula.war file automatically initializes the database with the necessary tables and table schemas.
Ensure that the username specified in the JNDI database resource definition has permissions to the database so that the akula.war can modify the database tables and table schemas. For more information, see the example below.
Step 2: Configuring an Akula Server to reference the external database
AKULA_HOME/global/context.properties file to configure the Akula Server to reference an external database.
The context.properties contains the following properties:
|Set to |
Specifies a JNDI database resource on your JEE server or servlet container that defines the connection information to your database.
|Specifies the database name.|
Specifies the Hibernate dialect class that corresponds to your database.
For example, if you are using MySQL, the corresponding Hibernate dialect class is org.hibernate.dialect.MySQLDialect.
After editing the context.properties file, you must restart the Akula server.
Example context.properties file
Shown below is an example context.properties file:
In this example, you connect the Akula server to a MySQL database in a production environment. Therefore, the
hibernate.dialect property references the org.hibernate.dialect.MySQLDialect class.
db_jndi_name property is set to
java:comp/env/jdbc/akula-db to specify the JNDI database resource. You therefore require a corresponding JNDI database resource definition on your JEE server or servlet container named
For example, if you are running the Akula Server on Tomcat, you would add the following resource definition to the Tomcat context.xml file:
If you are not using Tomcat, define the JNDI resource as appropriate for your JEE server or servlet container.
The akula.war file automatically initializes its database when you first start it. Therefore, ensure that the username specified in the JNDI database resource definition has permissions to the database so that the akula.war file can modify the database tables and table schemas.
Step 3: Start the akula.war
Starting the akula.war on your JEE server or servlet container initializes the database.
Share the database across multiple Akula Servers
In a deployment environment, you deploy a single Akula Server on a host computer. To share the configuration database across multiple Akula Servers, you only need to make sure that the JNDI resource definition for each JEE server or servlet container references the same database.
Where to go next
Now that you have set up the Akula Server database, go to 3. Deploy the Akula WAR file on Your Java Server.