To connect Nuxeo to your database, you need to tell Nuxeo which database template to use and provide the database connection information.
Connecting Nuxeo to the Database From the nuxeo.conf File
By default, the "default" template is enabled on your Nuxeo server (see the Database templates section for more information on this template). You need to edit it to change the template to be used.
Open your
nuxeo.conf
file with a text editor.For Windows usersDo not use Office writers, nor Notepad.
Wordpad is fine, Notepad++ and SciTE are good text editors, there are a lot of other text editors.
- If needed, uncomment or edit the
nuxeo.templates
parameter and replacedefault
with the wanted database template's name (see Database Templates section). - Depending on your Database choice, you have to uncomment or edit the parameters below and provide their values:
- SQL Database:
nuxeo.db.name
nuxeo.db.user
nuxeo.db.password
nuxeo.db.host
nuxeo.db.port
- MongoDB Database:
nuxeo.mongodb.server
nuxeo.mongodb.dbname
- SQL Database:
- Save your modifications.
- Restart the server.
These are the minimum required parameters to enable the Nuxeo server to communicate with the database. For a production or load testing environment, you may need to provide the other commented parameters.
Database Templates
The default available database templates are:
common
: Common template used by other templatescustom
: Sample custom templates. Of course, this template is empty by default. One should copy it outside$NUXEO_HOME
and adapt to their needs. See related section below.default
: default Nuxeo configuration template for test purposedocker
: Template to be used in the Docker image to only append the server logs to the console, not to aserver.log
file. Also, see the page about Logs.docker-json
: Same as thedocker
template but allows to append the console logs as JSON.https
: (not recommended) Template to make the server listen to port 443 (HTTPS)mariadb
: MariaDB configuration template (since Nuxeo FT 9.1; for older versions of Nuxeo themysql
template should be used)mariadb-quartz-cluster
mongodb
: MongoDB configuration templatemssql
: MS SQL Server configuration templatemssql-quartz-cluster
mysql
: MySQL configuration templatemysql-quartz-cluster
oracle
: Oracle configuration templateoracle-quartz-cluster
;postgresql
: PostgreSQL configuration templatepostgresql-quartz-cluster
The most commonly used templates are described below. For more information read the page Configuration Templates.
Default
This is the default Nuxeo configuration using an embedded H2 database. It is designed for development or test purpose. Do not use this in production or for performance evaluations.
- Repository backend: H2
- Services backend: H2
PostgreSQL (Recommended)
This is the recommended configuration for production, based on PostgreSQL.
- Repository backend: PostgreSQL XA
- Services backend: PostgreSQL XA
The PostgreSQL driver is included in the Nuxeo applications by default. However, if needed you can download a more recent version from http://jdbc.postgresql.org/download.html#current.
The JAR (for instance postgresql-9.4-1212.jar
) is located in $NUXEO/lib/
.
You can use a later driver with an earlier database version, for instance the 9.4 driver still works with PostgreSQL 9.2 or 9.3.
See the page PostgreSQL for more information on the database configuration.
Oracle
- Repository backend: Oracle XA
- Services backend: Oracle XA
The driver is not included in Nuxeo applications for legal reasons. To install it:
- Download the appropriate JDBC driver from http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html.
- The JAR (
ojdbc7.jar
) must be placed in$NUXEO/lib/
.
See the page Oracle for more information on the database configuration.
Microsoft SQL Server
- Repository backend: Microsoft SQL Server XA
- Services backend: Microsoft SQL Server XA
The Microsoft JDBC driver is already shipped with Nuxeo.
The JAR (for instance sqljdbc-4.2.6420.jar
) is located in $NUXEO/lib/
.
See the page Microsoft SQL Server for more information on the database configuration.
MySQL
- Repository backend: MySQL XA
- Services backend: MySQL XA
The JDBC driver (dowloadable from http://www.mysql.com/downloads/connector/j/) is included in Nuxeo applications and is located in $NUXEO/lib/
.
We recommend using a near-infinite wait_timeout in the MySQL server configuration. See the page MySQL for more information on the database configuration.
Connecting Nuxeo to the Database From the JSF Admin Center
- In the Admin Center, click on the Setup tab of system information section.
- In the Main information section, select the target database in the drop down menu.
A new Database Information section is displayed on the page.
- Fill in the database connection information.
- Click on the Save button displayed below the Email information section.
- Restart your server.