By default, GateIn is configured to use the Hypersonic SQL database and a relative folder in the bundle to manage the content storage. This type of setting is only useful for running a product demo without specifying any parameter, but this is not the suggested way to set up the platform for a production environment.
For production system environments, you should configure GateIn for using external DBMS and using a file system with good I/O performance to prevent bottlenecks during reading and writing operations on contents and search indexes.
We are going to configure the components that manage content storage in GateIn:
Let's first configure exoJCR, which is the component responsible for the content storage in the portal. This component consists of two physical storage elements:
Finally, we will see how to configure a JBoss identity that is based only on a separate database instance.
Locate the configuration file in the shared class loader according to your application server. Assuming that you are using Tomcat, the configuration file is located here:
<TOMCAT6_HOME>/gatein/conf/configuration.properties
If you are using JBoss AS 6 you will find it at the following location:
<JBOSS6_HOME>/server/default/conf/gatein/configuration.properties
If you want to use JBoss AS 7, you have to edit the configuration file here:
<JBOSS7_HOME>/standalone/configuration/gatein/configuration.properties
Carry out the following steps to configure the content storage:
gatein.jcr.datasource.driver
gatein.jcr.datasource.url
gatein.jcr.datasource.username
gatein.jcr.datasource.password
The default database settings of the JCR component of GateIn are based on these standard JDBC parameters:
gatein.jcr.datasource.driver=org.hsqldb.jdbcDriver
gatein.jcr.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcjcr_${name}
gatein.jcr.datasource.username=sa
gatein.jcr.datasource.password=
The above parameters will configure your HSQL database in a folder in your file system. As you can see, the parameter named gatein.db.data.dir
, used for the value of the parameter gatein.jcr.datasource.url
, allows you to set a specific folder that will contain all the content storage dedicated to the GateIn instance.
These parameters allow you to set the typical settings for a JDBC connection, so for example, if you need to configure Oracle DBMS for the JCR database, you should have a similar configuration to the following:
gatein.jcr.datasource.driver=oracle.jdbc.OracleDriver
gatein.jcr.datasource.url=jdbc:oracle:thin:@<HOST>:<PORT>:gateInJcr
gatein.jcr.datasource.username=<ORACLE USERNAME>
gatein.jcr.datasource.password=<ORACLE USER PASSWORD>
latin1
, so be sure to set this parameter in your DBMS configuration.For Tomcat, you can copy the JDBC driver in this folder:
<TOMCAT6_HOME>/lib
For JBoss 6 AS you can use this one:
<JBOSS6_HOME>/server/default/lib
For JBoss 7 AS the following directory is available here:
<JBOSS7_HOME>/standalone/lib
gatein.data.dir=../gatein/data
gatein.jcr.data.dir=${gatein.data.dir}/jcr
gatein.jcr.storage.data.dir=${gatein.jcr.data.dir}/values
gatein.jcr.index.data.dir=${gatein.jcr.data.dir}/lucene
Using these parameters, you can change the default location of the content binaries of GateIn. Here, you can change the default configuration for contents and search indexes as needed for your architecture.
gatein.idm.datasource.driver=org.hsqldb.jdbcDriver
gatein.idm.datasource.url=jdbc:hsqldb:file:${gatein.db.data.dir}/data/jdbcidm_${name}
gatein.idm.datasource.username=sa
gatein.idm.datasource.password=
As seen above for the JCR database settings, a potential configuration for an Oracle database dedicated to the identity manager could be the following:
gatein.idm.datasource.driver= oracle.jdbc.OracleDriver
gatein.idm.datasource.url=jdbc:oracle:thin:@<HOST>:<PORT>:gateInIdm
gatein.idm.datasource.username=<ORACLE USERNAME>
gatein.idm.datasource.password=<ORACLE USER PASSWORD>
In the previous steps, we have configured the content storage of GateIn that will be used to create all the needed data structures (tables in the database and folders in the file system) for managing portal contents.
When the application server runs for the first time, GateIn will automatically create all the needed data structures in the database and inside the file system.
The database connection used in GateIn is a standard JDBC connection that requires the usual parameters for configuration:
The driver class is the Java class of the DBMS driver that allows remote access to the database instance for managing JDBC connections.
The value for the JDBC URL must follow your specific DBMS conventions to locate the database instance remotely via JDBC.
The username and password are related to a specific users credentials that GateIn must use to access and manipulate contents in the database.
You also have the possibility to configure contents and indexes to increase performance during searching or creating contents. This is done by changing locations to machines with better hardware for both of the components.
A typical approach is to dedicate the local file system storage to the Apache Lucene indexes (gatein.jcr.index.data.dir
) and a high-performance storage location for contents, setting a different value for the gatein.jcr.storage.data.dir
property.
Apache Lucene is an open-source text-search engine library used in many Enterprise products to create and manage content indexes. It supports execution of queries based on the Lucene Query Language, which is a very powerful query language that can search contents by ranking, phrase, and exact match. Lucene is licensed under Apache Software License Version 2.0.
For more information about Lucene, you can visit the project website at http://lucene.apache.org/.
In order to configure MySQL for the database storage of GateIn, you should edit the configuration file in a similar way for JCR, following the related conventions:
gatein.jcr.datasource.driver=com.mysql.jdbc.Driver
gatein.jcr.datasource.url=jdbc:mysql://<HOST>:<PORT>/gateInJcr
gatein.jcr.datasource.username=<MYSQL USERNAME>
gatein.jcr.datasource.password=<MYSQL USER PASSWORD>
For the identity manager you should have the following:
gatein.idm.datasource.driver=com.mysql.jdbc.Driver
gatein.idm.datasource.url=jdbc:mysql://<HOST>:<PORT>/gateInIdm
gatein.idm.datasource.username=<MYSQL USERNAME>
gatein.idm.datasource.password=<MYSQL USER PASSWORD>
Finally, remember to copy the MySQL JDBC driver library into the application server library folder in order to make the driver class available to GateIn.
3.139.97.202