Use MySQL or MariaDB as your repository database (Archive installation)

Use these steps to install MySQL or MariaDB as the host database for the Pentaho Server in an archive installation of Pentaho.

Prerequisites

Before you prepare your Pentaho Repository, prepare either a Windows or Linux environment:

circle-exclamation

Components

The Pentaho Repository resides on the database you installed during the environment preparation step.

It includes these components:

  • Jackrabbit Contains the solution repository, examples, security data, and content data from reports that you create.

  • Quartz Holds data related to scheduling reports and jobs.

  • Hibernate Holds data related to audit logging.

  • (Optional) Pentaho Operations Mart Reports on system usage and performance.

Initialize the repository database

To initialize MySQL or MariaDB so that it serves as the Pentaho Repository, run several SQL scripts to create the Hibernate, Quartz, Jackrabbit (JCR), and Pentaho Operations Mart components.

circle-exclamation
circle-exclamation
circle-exclamation

Failure to complete the Quartz upgrade results in a Pentaho Server start-up error. In addition to the server error, the following exception message is generated in the catalina.log file:

1

Step 1: Change default passwords

For production, follow best practices and change the default passwords in the SQL script files.

circle-info

If you are evaluating Pentaho, you can skip this step.

  1. Browse to the <your pentaho directory>/pentaho-server/data/mysql folder.

  2. Use a text editor to update these scripts as needed for your existing user, password, database, and other values:

    • create_jcr_mysql.sql

    • create_quartz_mysql.sql

    • create_repository_mysql.sql

    • pentaho_mart_mysql.sql

  3. Save and close the files.

2

Step 2: Run SQL scripts

When upgrading from previous Pentaho versions (including 10.2.0.0 GA to 10.2.0.1 and later), you must manually initialize a new Quartz database. This creates a new Quartz library in the repository database.

If you want to keep existing Quartz schedules, migrate the old tables to the new tables.

circle-info

You may need administrator permissions to run these scripts on the host OS.

  1. If the Pentaho Server is running, stop it. See Stop and start the Pentaho Server and repository.

  2. Make sure your MySQL or MariaDB instance is running.

  3. Open MySQL Workbench or a MySQL/MariaDB command prompt.

  4. Run the SQL creation scripts in this order:

    1. <your pentaho directory>/pentaho-server/data/mysql/create_jcr_mysql.sql

    2. <your pentaho directory>/pentaho-server/data/mysql/create_quartz_mysql.sql

    3. <your pentaho directory>/pentaho-server/data/mysql/create_repository_mysql.sql

    4. <your pentaho directory>/pentaho-server/data/mysql/pentaho_mart_mysql.sql

    This creates the Quartz database, the Jackrabbit and MySQL/MariaDB repositories, and Pentaho Operations Mart.

    The scripts create the new Quartz scheduler tables prefixed with QRTZ6_.

    Any existing QRTZ5_ tables are retained. Starting the Pentaho Server at this point results in an empty schedule.

  5. If you want to retain your existing scheduler data, open migrate_old_quartz_data_mysql.sql in a text editor.

  6. Update the migration script for your user, password, database, and other values. Save the file.

  7. Run the migration script:

    <your pentaho directory>/pentaho-server/data/mysql/migrate_old_quartz_data_mysql.sql

The original Quartz scheduler database is migrated to the new Quartz database.

circle-info

The original QRTZ5_ data is retained. You can delete it after you confirm migration success.

circle-info

You unpacked the Pentaho Operations Mart SQL file while preparing your environment for the archive installation.

See Prepare your Windows environment for an archive install or Prepare your Linux environment for an archive install.

3

Step 3: Verify MySQL or MariaDB initialization

circle-info

Unless you changed it in Step 1, the default password for each username below is password.

After you run the scripts, verify the databases and user roles were created properly:

  1. Open MySQL Workbench.

  2. Log in as hibuser.

  3. Under Schemas, expand hibernate > Tables.

  4. If you installed Pentaho Operations Mart, expand pentaho_operations_mart > Tables.

  5. Log in as jcr_user.

  6. Under Schemas, expand jackrabbit > Tables.

    circle-info

    The Jackrabbit tables might not appear until after you start Pentaho for the first time.

  7. Log in as pentaho_user.

  8. Under Schemas, expand quartz > Tables.

  9. Exit MySQL Workbench.

You have initialized the MySQL or MariaDB Pentaho Repository database.

Configure the repository database

Now that you have initialized your repository database, configure Quartz, Hibernate, Jackrabbit, and Pentaho Operations Mart for MySQL or MariaDB.

The examples assume MySQL on port 3306 with default passwords.

circle-exclamation
1

Step 1: Set up Quartz on MySQL or MariaDB

Quartz stores scheduler data, such as scheduled reports.

You point Pentaho at the correct JobStore by updating quartz.properties.

  1. Open pentaho/server/pentaho-server/pentaho-solutions/system/scheduler-plugin/quartz/quartz.properties.

  2. In #_replace_jobstore_properties, set org.quartz.jobStore.driverDelegateClass:

  1. Save the file.

2

Step 2: Set Hibernate settings for MySQL or MariaDB

Hibernate settings point Pentaho to the correct Hibernate configuration file.

circle-info

Hibernate also stores the audit logs used by Operations Mart.

Files are in pentaho/server/pentaho-server/pentaho-solutions/system/hibernate.

  1. Open hibernate-settings.xml.

  2. Find the <config-file> entry. Replace postgresql.hibernate.cfg.xml with mysql5.hibernate.cfg.xml:

From:

To:

  1. Save and close the file.

  2. (MariaDB only) Open mysql5.hibernate.cfg.xml.

  3. Find the driver class and change it from MySQL to MariaDB:

From:

To:

3

Step 3: Replace the audit log file with the MySQL version

Replace audit_sql.xml with the MySQL version.

Use the same file for MariaDB.

  1. Locate pentaho-solutions/system/dialects/mysql5/audit_sql.xml.

  2. Copy it into pentaho-solutions/system.

4

Step 4: Modify Jackrabbit repository information for MySQL or MariaDB

Update Jackrabbit to use the MySQL (or MariaDB) repository.

  1. Open pentaho/server/pentaho-server/pentaho-solutions/system/jackrabbit/repository.xml.

  2. Uncomment the MySQL lines.

  3. Comment out the MS SQL Server, Oracle, and PostgreSQL lines.

  4. Verify these sections use the MySQL values.

Item

Code Section

Repository

DataStore

Workspaces

PersistenceManager (1st part)

Versioning

PersistenceManager (2nd part)

DatabaseJournal

Perform Tomcat-specific connection tasks

After your repository is configured, configure the web application server to connect to the Pentaho Repository.

In this step, you will make JDBC and JNDI connections to the Hibernate, Jackrabbit, and Quartz components.

circle-info

By default, the Pentaho Server software is configured to deploy and run on Tomcat. Connections are already specified. Only update the Tomcat context.xml file if you changed default ports or passwords.

Step 1: Download driver and apply to the Pentaho Server

To connect to a database, including the Pentaho Repository database, download and copy a JDBC driver to the right locations for the Pentaho Server and the web application server.

circle-info

Due to licensing restrictions, Pentaho cannot redistribute some third-party database drivers. You must download and install these files yourself.

  1. Download a JDBC driver JAR from your database vendor or a third-party driver developer. The JDBC drivers reference lists supported drivers.

  2. Copy the JDBC driver JAR to the pentaho/server/pentaho-server/tomcat/lib folder.

  3. Copy the hsqldb-2.3.2.jararrow-up-right file to pentaho-server/tomcat/lib if you want to keep the Pentaho sample.

Step 2: Modify JDBC connection information in the Tomcat XML file

Database connection and network settings (username, password, driver class, IP address or domain name, and port numbers) for your Pentaho Repository database are stored in the context.xml file.

Update this file to match your environment.

circle-exclamation
  1. Consult your database documentation to determine the JDBC class name and the connection string for your Pentaho Repository database.

  2. Go to server/pentaho-server/tomcat/webapps/pentaho/META-INF and open context.xml in a text editor.

  3. Add the following code if it does not already exist.

    For MySQL:

    For MariaDB:

  4. Update usernames, passwords, driver classes, IP addresses (or domain names), and port numbers to match your environment.

  5. Comment out resource references for databases you are not using.

  6. Verify validationQuery is set to select 1 (for example: validationQuery="select 1").

  7. Save context.xml, then close it.

Start the Pentaho Server

Now that you have completed the initial Pentaho archive installation steps, you are ready to start the Pentaho Server.

Starting the Pentaho Server after an archive installation

Last updated

Was this helpful?