Pentaho 3 7 0 Windows and MySQL
Pentaho 3 7 0 Windows and MySQL
Pentaho 3 7 0 Windows and MySQL
x and Windows
Table of Contents
1. Introduction a. License b. About c. The Community d. Thanks 2. Getting Started a. Installing and Configuring Java b. Installing and Configuring MySQL 5.x Server c. Deploying the Platform i. Packaged Apache-Tomcat Server ii. Existing Apache-Tomcat Server 1. MySQL Java Connector 2. webapps d. SQL Script Pack 3. Configuring the Databases a. Extract the MySQL 5.x SQL Script Pack b. Load the SQL scripts 4. Configuring JDBC Security i. applicationContext-spring-security-jdbc.xml ii. applicationContext-spring-security-hibernate.properties iii. hibernate-settings.xml iv. (optional) 5. Configuring Hibernate and Quartz 6. Configuring Apache-Tomcat Server i. solution-path ii. fully-qualified-server-url iii. TrustedIpAddrs iv. Other Parameters 7. Configuring SMTP (mail server) 8. Configuring Publishing 9. Configuring the Administration Console 10. Starting the Business Intelligence Platform 11. Starting the Administration Console
Introduction
License
This work is licensed under a Creative Commons Attribution 3.0 Australia License.
About
To use this guide It is assumed that readers have intermediate to advanced knowledge in their setup of choice and basic knowledge of Pentaho (although it is not needed). The following operating systems and databases are supported:
Windows * o MySQL 5.x * o PostgreSQL 8.x.x o Oracle 10g & 11g o Microsoft SQL Server 2005+ Linux o MySQL 5.x o PostgreSQL 8.x.x o Oracle 10g & 11g
The Community
Don't forget about the other hardworking projects which are part of the Pentaho community and also deserve a donation: PAT (Pentaho Analysis Tool) An alternative to Pentaho's current OLAP analyser tool, JPivot. CDF (Community Dashboard Framework) A framework for building dashboards within Pentaho's Business Intelligence Server User Console. CBF (Community Build Framework) Is an ant build.xml file script and alternate way to setup and deploy Pentaho based applications CDA (Community Data Access) A data access layer for CDF (Community Dashboard Framework).
Thanks
Thanks to the following blogs, individuals, companies and groups: ##pentaho & ##pentaho.pat IRC channels found on Freenode (Pentaho and Pentaho PAT). Pentaho Wiki & Pentaho Forums The first place any new user to Pentaho should look. Open Source Business Intelligence Provided a working copy of the sample database for MySQL. Bizcubed Provided a working copy of the sample database for PostgreSQL - they are also Australian! Pentaho Solutions: Business Intelligence and Data Warehousing with Pentaho and MySQL A book by Roland and Jos van Dongen.
Getting Started
Installing and Configuring Java
The Pentaho BI Platform requires a JVM (Java Virtual Machine) to be installed on your PC or server. To check if Java is already installed issue the following command (seen in bold) at the command prompt:
C:\>java -version java version "1.6.0_13" Java(TM) SE Runtime Environment (build 1.6.0_13-b03) Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
If a similar output (seen above) is displayed Java is already installed. If not, to install Java on Windows you will need to download the Java installation file from the Sun Developer Network downloads page. The next step is to check if the JAVA_HOME environment variable is setup correctly, issue the following command (seen in bold) at the command prompt:
C:\>echo %JAVA_HOME% C:\Program Files\Java\jdk1.6.0_13 If a similar output (seen above) is displayed the JAVA_HOME environment variable is already setup. To setup the JAVA_HOME environment variable right click on My Computer and click the Properties option then the Advanced tab and click the Environment Variables button.
Depending on your setup (User variables or System variables)click on the New button to create a new Environment Variable (in this guide I will be adding them for the user). For the variable name enter JAVA_HOME and for the variable value find the location of your Java installation in this example it is c:\Program Files\Java\jdk1.6.0_13:
The CATALINA_OPTS environment variable should also be set to tell the Apache-Tomcat server to use more than the default memory, to do this follow the same steps from above but this time make sure you set the variable name to CATALINA_OPTS and the variable value to -Xms256m -Xmx768m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000:
From now on every time the PC or server is started/restarted the JAVA_HOME and CATALINA_OPTS environment variables will be set automatically.
C:\ |-- pentaho | |-- adminstration-console | |-- biserver-ce | |-- pentaho-solutions | |-- tomcat | |-- common | `-- lib | `-- mysql-connector-java-5.0.7.jar (optional) | |-- webapps | `-- pentaho | `-- pentaho-styles | `-- sw-styles
The files and folders in bold (seen above) will need to be moved to your existing Apache-Tomcat installation. MySQL Java Connector If you already have Apache-Tomcat working with MySQL then you won't need to copy the mysql-connectorjava-5.0.7.jar file to your tomcat's \common\lib folder. If not to copy the mysql-connector-java5.0.7.jar to your tomcat's \common\lib folder. webapps You will need to copy all the folders under the C:\pentaho\biserver-ce\tomcat\webapps\ folder to the webapps\ folder under your existing Apache-Tomcat installation (the sw-styles webapp is optional). The last step is to move the pentaho-solutions folder into the C:\pentaho\ folder or any other location which you would like to store all your pentaho solutions and configuration files. One more step will need to be done to make sure Pentaho knows the new location of the pentaho-solutions folder which will be covered in the "Configuring Apache-Tomcat" section. The new structure of the pentaho-solutions and existing Apache-Tomcat folder looks like this: C:\ |-| |-| pentaho `-- pentaho-solutions tomcat -- webapps
You can now safely remove any other files that came with the original Pentaho BI Platform (only under the biserver-ce/ folder).
1_create_repository_mysql.sql Creates the Hibernate database 2_create_quartz_mysql.sql Creates the Quartz database 3_create_sample_datasource_mysql.sql Loads the sample data data source into the Hibernate database 4_load_sample_users_mysql.sql Creates all the sample users and roles into the Hibernate database 5_sample_data_mysql.sql Creates the sample data database
You must load the above scripts in the order they are listed. Load these SQL scripts using your favourite MySQL front end tool i.e. MySQL console, Navicat Lite, phpMyAdmin etc (in this section I will show you how to load the SQL scripts using the MySQL console).
Issue the following commands found in bold one after the other:
mysql> source 1_create_repository_mysql.sql; ...output mysql> source 2_create_quartz_mysql.sql; ...output mysql> source 3_create_sample_datasource_mysql.sql; ...output mysql> source 4_load_sample_users_mysql.sql; ...output mysql> source 5_sample_data_mysql.sql; ...output
Now run the following command (in bold) to see if you have successfully created the hibernate, quartz and sampledata databases:
Just for reference here are the databases and tables which should of been created after loading the contents of the MySQL 5.x SQL Script pack:
hibernate* o authorities o datasource o granted_authorities o users quartz o qrtz_blob_triggers o qrtz_calendars o qrtz_cron_triggers o qrtz_fired_triggers o qrtz_job_details o qrtz_job_listeners o qrtz_locks o qrtz_paused_trigger_grps o qrtz_scheduler_state o qrtz_simple_triggers o qrtz_trigger_listeners o qrtz_triggers sampledata o customer_w_ter o customers o department_managers o dim_time o employees o offices o orderdetails o orderfact o orders o payments o products o quadrant_actuals o trial_balance
* Hibernate will create new tables into the hibernate database after Pentaho BI Platform has started for the first time.
NOTE If you have problems when running the 5_sample_data_mysql.sql scripts with timestamps you will need to replace all occurances of 00.000000000 with 00.000000 - this is an issue with MySQL timezones and timestamps.
NOTE If you already have a user which you prefer to have access to the hibernate database instead of the default user hibuser, you will need to modify all occurances of hibuser/password in this section.
applicationContext-spring-security-jdbc.xml
This file is located under the pentaho-solutions\system\ folder. Once the file has opened locate this snippet of code:
<!-- This is only for Hypersonic. Please update this section for any other database you are using --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="org.hsqldb.jdbcDriver" /> <property name="url" value="jdbc:hsqldb:hsql://localhost:9001/hibernate" /> <property name="username" value="hibuser" /> <property name="password" value="password" /> </bean>
Make changes to the highlighted sections so that the section of code looks similar to this: <!-- This is only for Hypersonic. Please update this section for any other database you are using --> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <property name="url" value="jdbc:mysql://localhost:3306/hibernate" /> <property name="username" value="hibuser" /> <property name="password" value="password" /> </bean>
applicationContext-spring-security-hibernate.properties
This file is located under the pentaho-solutions\system\ folder. Once the file has opened locate this snippet of code: jdbc.driver=org.hsqldb.jdbcDriver jdbc.url=jdbc:hsqldb:hsql://localhost:9001/hibernate jdbc.username=hibuser jdbc.password=password hibernate.dialect=org.hibernate.dialect.HSQLDialect Make changes to the highlighted sections so that the section of code looks similar to this: jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/hibernate jdbc.username=hibuser jdbc.password=password hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate-settings.xml
This file is located under the pentaho-solutions\system\hibernate\ folder. Once the file has opened locate this snippet of code: <config-file>system/hibernate/hsql.hibernate.cfg.xml</config-file> Make changes to the highlighted section so that the section of code looks similar to this: <config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file>
(optional)
This file is located under the pentaho-solutions\system\hibernate\ folder. You do not need to make any changes to this file if you would like to use the default user hibuser (which was created with the 4_load_sample_users_mysql.sql file). However, if you would like to specify your own user find and change the following two lines of code: <property name="connection.username">hibuser</property> <property name="connection.password">password</property> Make changes to the highlighted sections to a username and password of your choice.
NOTE If you already have a user which you prefer to have access the hibernate database instead of the default user hibuser, you will need to modify all occurances of hibuser/password in this section.This also applies to the pentaho_user/password used to connect to the Quartz database. Once the file has opened the following piece of code should be visible: <?xml version="1.0" encoding="UTF-8"?> <Context path="/pentaho" docbase="webapps/pentaho/"> <Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5" maxWait="10000" username="hibuser" password="password" driverClassName="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:hsql://localhost/hibernate" validationQuery="select count(*) from INFORMATION_SCHEMA.SYSTEM_SEQUENCES" /> <Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5" maxWait="10000" username="pentaho_user" password="password" driverClassName="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:hsql://localhost/quartz" validationQuery="select count(*) from INFORMATION_SCHEMA.SYSTEM_SEQUENCES"/> </Context> Make changes to the highlighted sections so that the section of code looks similar to this: <?xml version="1.0" encoding="UTF-8"?> <Context path="/pentaho" docbase="webapps/pentaho/"> <Resource name="jdbc/Hibernate" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
maxWait="10000" username="hibuser" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/hibernate" validationQuery="select 1" /> <Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource" factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5" maxWait="10000" username="pentaho_user" password="password" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/quartz" validationQuery="select 1"/> </Context>
pentaho-solutions location URL TrustedIpAddrs (optional - for the administration console and if you are accessing the server remotely)
If you are happy with the following settings for your Pentaho BI Platform server you will not need to make any changes to this file: pentaho-solutions\ folder located under the C:\pentaho\ folder Visit http://localhost:8080/pentaho URL to launch the Pentaho BI Platform
solution-path
The solution-path parameter lets the Pentaho BI Platform know where to locate the pentaho-solutions folder. By default this is set to c:\biserver-ce\ folder. If you have decided to use an existing Apache-Tomcat server (or have moved your pentaho-solutions folder) you will need to point this to where you have placed your pentaho-solutions folder. In this example my pentaho-solutions folder is under the C:\pentaho\ folder, now my solution-path code snippet looks like this: <context-param>
fully-qualified-server-url
If you are happy with visiting the URL http://localhost:8080/pentaho to access Pentaho's BI Platform you will not need to change this parameter, however if you would like others to access the site (remotely or on a network) you will need to make changes to this parameter. Open up the file and locate this line of code: <param-value>http://localhost:8080/pentaho/</param-value> Make changes to the highlighted section to your PC or server's domain or IP address so it looks similar to this:
<param-value>http://www.prashantraju.com:8080/pentaho/</param-value> or <param-value>http://192.168.1.10:8080/pentaho/</param-value>
TrustedIpAddrs
If you want to access your Tomcat-Apache server remotely - so in the above step you have not specified localhost or 127.0.0.1 for the base-url parameter - you will need to add your Tomcat-Apache server's IP address to this list. Open up the file and locate this line of code:
<param-name>TrustedIpAddrs</param-name> <param-value>127.0.0.1</param-value>
Make changes to the highlighted section add your PC or server's domain or IP address so it looks similar to this: <param-name>TrustedIpAddrs</param-name> <param-value>127.0.0.1,[your_ip_address]</param-value>
This will allow the Pentaho Administration Console to 'ping' the server to see if it is up or down - you do not need to do this if you are hosting your server locally.
Other Parameters
You can also change the local language and country under the web.xml file, the changes to these parameters are self explanatory.
Here are the available parameters that can be configured for SMTP support:
mail.smtp.host o This is the address of your SMTP email server for sending email e.g. smtp.gmail.com mail.smtp.port o This is the port of your SMTP email server e.g. for GMail this is 587 mail.transport.protocol o The transport for accessing the email server. Usually this is smtp e.g. for GMail this is smtps mail.smtp.starttls.enable o If you SMTP server uses TTLS authentication set this to true e.g. for GMail this is true mail.smtp.auth o Set to true if the email server requires the sender to authenticate mail.smtp.ssl o This is true if the email server requires an SSL connection e.g. for GMail this is true mail.debug o Output debug information from the JavaMail API mail.pop3 o Not being used. mail.from.default o The from address that emails from the Pentaho BI Platform e.g. [email protected] mail.userid o The userid that is used when authenticating with the SMTP server, mail.smtp.auth must be set to true. mail.password o The password that is used when authenticating with the SMTP server, mail.smtp.auth must be set to true.
<email-smtp> <properties> <mail.smtp.host>smtp.gmail.com</mail.smtp.host> <mail.smtp.port>587</mail.smtp.port> <mail.transport.protocol>smtps</mail.transport.protocol> <mail.smtp.starttls.enable>true</mail.smtp.starttls.enable> <mail.smtp.auth>true</mail.smtp.auth> <mail.smtp.ssl>true</mail.smtp.ssl> <mail.smtp.quitwait>false</mail.smtp.quitwait> </properties> <mail.pop3></mail.pop3> <mail.from.default>[email protected]</mail.from.default> <mail.userid>[email protected]</mail.userid> <mail.password>password</mail.password> </email-smtp>
Configuring Publishing
By default publishing is not enabled, to enable it you will need to specify a password which will need to be used when publishing. To get started you will need to edit the publisher_config.xml file located under the pentaho-solutions\system\ folder, once open locate the following snippet of code:
<publisher-config> <publisher-password></publisher-password> </publisher-config> Enter a password between the publisher-password tags (this password will be the same for all users) so the snippet of code looks similar to the example below (in this example the publisher password is publishthis): <publisher-config> <publisher-password>publishthis</publisher-password> </publisher-config> From now on when any user tries to publish content to Pentaho BI Platform they will need to specify this password.
C:\pentaho\biserver-ce\tomcat\bin> service.bat install tomcat5 Installing the service 'tomcat5' ... Using CATALINA_HOME: Using CATALINA_BASE: Using JAVA_HOME: Using JVM: D:\pentaho\biserver-ce\tomcat D:\pentaho\biserver-ce\tomcat C:\Program Files\Java\jdk1.6.0_13 C:\Program Files\Java\jdk1.6.0_13\jre\bin\server\jvm.dll
The service 'tomcat5' has been installed. Once you have received the above output the next step is to start the Tomcat service. To do this firstly click on the Start button then Run and type in services.msc and click OK. A Services window should appear and it will list all available services, locate the Apache Tomcat tomcat5 service and double click on it to open up the Properties dialog box:
To start Tomcat click on the Start button (to stop Tomcat simply click on the Stop button).
Now you should be able to visit http://localhost:8080/pentaho or http:// [your_domain_or_ip]:8080/pentaho. If the Pentaho BI Platform has started successfully you should see the following welcome screen:
After logging in try and run a sample report from the Steel Wheels solution folder:
05/01/2010 4:27:18 PM org.pentaho.pac.server.JettyServer startServer INFO: Console is starting 2010-01-05 16:27:18.118::INFO: 2010-01-05 16:27:38.672::INFO: jetty-6.1.2 Started SocketConnector @ 0.0.0.0:8099
05/01/2010 4:27:38 PM org.pentaho.pac.server.JettyServer startServer INFO: Console is now started. It can be accessed using http://D119940:8099 or http://161.117.117.40:8099 Now you should be able to visit http://localhost:8099/ or the other two address's specified in your output (highlighted above). You will be prompted for a Username and Password which by default are "admin" and "password". If you have successfully started and logged into the administration console you should see the following welcome screen:
Page 1 of 1