Set up a cluster
A Pentaho node consists of a Tomcat Web App server and the Pentaho Server. Multiple nodes that are joined make up a cluster. You can create a cluster using any version of Pentaho Suite 6.x or later.
The following topics explain how to cluster the application server:
- Step 1: Address prerequisites for clustering
- Step 2: Initialize and configure repository
- Step 3: Configure Jackrabbit Journal
- Step 4: Configure Quartz
- Step 5: Start and test the cluster
Step 1: Address prerequisites for clustering
Before you begin the process of clustering your servers, a few tasks need to be preformed and some specific requirements must be met to successfully implement a Pentaho deployment on a Tomcat or JBoss cluster. The following table describes these tasks and requirements:
Requirement | Description |
Make sure that all of your application nodes are set up with identical configurations and Pentaho deployments. | Your application nodes all need the same configurations and Pentaho deployments installed already in order for clustering to work. |
Establish a load balancer. | This will make sure that computing resources are spread evenly among the nodes. |
Each node and the load balancer must be time-synchronized via NTP. | All machines that make up the cluster have to have the same system time. If they do not, execution times of objects will be effected. |
You must run only one node per machine (or NIC). | It is possible to run multiple application servers on each node with a modified configuration, but this scenario does not offer any benefit for load balancing (performance) or hardware failover (redundancy), and therefore is not covered in this guide. Refer to your application server's clustering documentation for more information. |
You must use Tomcat 8.x or JBoss EAP 6.4.x. See Application servers for more information. | You may be able to use this guide as a basic blueprint for configuring other application servers or versions of Tomcat and JBoss for a clustered environment, but Pentaho support will not be able to assist you if you run into any problems with the Pentaho Server. |
You must have permission to install software and modify service configurations. | If you do not have permissions, you must have access to someone at your company who does have the correct permission levels, typically root access. |
Only the Pentaho Server will be deployed to the cluster. | It is possible to modify the configuration to deploy other WARs or EARs. However, for ease of testing and support, Pentaho only supports deployment of the pentaho and pentaho-style WARs to the cluster. |
You must use a single repository location. | Most people use a database-based solution repository. Keep in mind that you are not clustering the database server in this procedure, only the application server. |
You must have sticky sessions enabled. | This will tie your session to a single node. |
Step 2: Initialize and configure repository
Procedure
Initialize your database using the steps in the appropriate article for your system.
- If you performed an Archive install, see PostgreSQL, MySQL, MS SQL Server, or Oracle for your type of database.
- If you performed a Manual install, see PostgreSQL, MySQL, MS SQL, or Oracle for your type of database.
After you have initialized your database, you will need to configure the data connections to the Pentaho Repository. Specify data connections walks you through the steps for JDBC and JNDI connections for PostgreSQL, MySQL, and Oracle.
The next step is to configure your repository using the appropriate tasks.
- If you performed an Archive install, see PostgreSQL, MySQL, MS SQL Server, or Oracle for your type of database.
- If you performed a Manual install, see PostgreSQL, MySQL, MS SQL Server, or Oracle for your type of database.
After you have initialized and configured your repository, you should clean up these files by following these steps.
- Locate the pentaho-server/tomcat directory and remove all files and folders from the temp folder.
- Locate the pentaho-server/tomcat directory and remove all files and folders from the work folder.
- Locate the pentaho-server/pentaho-solutions/system/jackrabbit/repository directory and remove all files and folders from the final repository folder.
- Locate the pentaho-server/pentaho-solutions/system/jackrabbit/repository directory and remove all files and folders from the workspaces folder.
Results
Step 3: Configure Jackrabbit Journal
Procedure
Locate the repository.xml file in the pentaho-server/pentaho-solutions/system/jackrabbit directory and open it with any text editor.
Scroll to the bottom of the file and replace the section that begins with
For PostgreSQL only:<!-- Run with a cluster journal -->
with the correct code for your type of database repository.<!-- Run with a cluster journal --> <Cluster id="Unique_ID"> <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal"> <param name="revision" value="${rep.home}/revision.log"/> <param name="url" value="jdbc:postgresql://HOSTNAME:PORT/jackrabbit"/> <param name="driver" value="org.postgresql.Driver"/> <param name="user" value="jcr_user"/> <param name="password" value="password"/> <param name="databaseType" value="postgresql"/> <param name="janitorEnabled" value="true"/> <param name="janitorSleep" value="86400"/> <param name="janitorFirstRunHourOfDay" value="3"/> </Journal> </Cluster>
For MySQL only:<!-- Run with a cluster journal --> <Cluster id="Unique_ID"> <Journal class="org.apache.jackrabbit.core.journal.DatabaseJournal"> <param name="revision" value="${rep.home}/revision.log"/> <param name="url" value="jdbc:mysql://HOSTNAME:PORT/jackrabbit"/> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="user" value="jcr_user"/> <param name="password" value="password"/> <param name="schema" value="mysql"/> <param name="databaseType" value="mysql"/> <param name="janitorEnabled" value="true"/> <param name="janitorSleep" value="86400"/> <param name="janitorFirstRunHourOfDay" value="3"/> </Journal> </Cluster>
For Oracle only:<!-- Run with a cluster journal --> <Cluster id="Unique_ID"> <Journal class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal"> <param name="revision" value="${rep.home}/revision.log" /> <param name="url" value="jdbc:oracle:thin://localhost:1521/jackrabbit"/> <param name="driver" value="oracle.jdbc.OracleDriver"/> <param name="user" value="jcr_user"/> <param name="password" value="password"/> <param name="schema" value="oracle"/> <param name="janitorEnabled" value="true"/> <param name="janitorSleep" value="86400"/> <param name="janitorFirstRunHourOfDay" value="3"/> </Journal> </Cluster>"
For MS SQL Server only:<!-- Run with a cluster journal --> <Cluster id="Unique_ID"> <Journal class="org.apache.jackrabbit.core.journal.MSSqlDatabaseJournal"> <param name="revision" value="${rep.home}/revision.log"/> <param name="url" value="jdbc:sqlserver://localhost:1433;databaseName=jackrabbit"/> <param name="driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/> <param name="user" value="jcr_user"/> <param name="password" value="password"/> <param name="schema" value="mssql"/> <param name="janitorEnabled" value="true"/> <param name="janitorSleep" value="86400"/> <param name="janitorFirstRunHourOfDay" value="3"/> </Journal> </Cluster>
Save and close the file.
Results
Next steps
Step 4: Configure Quartz
Procedure
Locate the quartz.properties file in the pentaho-server/pentaho-solutions/system/quartz directory and open it with any text editor.
Find the org.quartz.scheduler.instanceId = INSTANCE_ID line and change INSTANCE_ID to AUTO.
org.quartz.scheduler.instanceId = AUTO
Find the
#_replace_jobstore_properties
section and change the default value of org.quartz.jobStore.isClustered to true as shown:#_replace_jobstore_properties org.quartz.jobStore.misfireThreshold = 60000 org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate org.quartz.jobStore.useProperties = false org.quartz.jobStore.dataSource = myDS org.quartz.jobStore.tablePrefix = QRTZ5_ org.quartz.jobStore.isClustered = true
Add this line just after the org.quartz.jobStore.isClustered = true line:
org.quartz.jobStore.clusterCheckinInterval = 20000
Results
Step 5: Start and test the cluster
Procedure
Start the solution database.
Start the application server on each node.
Make sure that the load balancer is able to ping each node.
Repeat for each node that you have set up.
Test the cluster by accessing the Pentaho Server through the load balancer's IP address, hostname, or domain name.
Next steps