Professional Documents
Culture Documents
x and Linux
Page 1 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Table of Contents
Table of Contents .............................................................................................................. 2 Introduction ....................................................................................................................... 3 License ............................................................................................................................ 3 Donate ............................................................................................................................. 3 You can donate to my PayPal account by clicking here. ................................................. 3 About ............................................................................................................................... 3 The Community ............................................................................................................... 3 Thanks ............................................................................................................................. 4 Getting Started .................................................................................................................. 5 Installing and Configuring Java ....................................................................................... 5 Installing and Configuring MySQL 5.x Server.................................................................. 5 Deploying the Platform .................................................................................................... 6 Packaged Apache-Tomcat Server ............................................................................... 6 Existing Apache-Tomcat Server .................................................................................. 6 MySQL Java Connector ........................................................................................... 7 webapps ................................................................................................................... 7 SQL Script Pack .............................................................................................................. 8 Configuring the Databases............................................................................................... 9 Extract the MySQL 5.x SQL Script Pack ......................................................................... 9 Load the SQL scripts ....................................................................................................... 9 Configuring JDBC Security ............................................................................................ 11 applicationContext-spring-security-jdbc.xml .............................................................. 11 applicationContext-spring-security-hibernate.properties............................................ 11 hibernate-settings.xml ................................................................................................ 12 mysql5.hibernate.cfg.xml (optional) ........................................................................... 12 Configuring Hibernate and Quartz................................................................................. 13 Configuring Apache-Tomcat Server.............................................................................. 15 solution-path .............................................................................................................. 15 fully-qualified-server-url.............................................................................................. 15 Disable HSQL Database Startup ............................................................................... 16 TrustedIpAddrs........................................................................................................... 16 Other Parameters....................................................................................................... 17 Configuring SMTP (mail server)..................................................................................... 18 Configuring Publishing................................................................................................... 20 Configuring the Administration Console ...................................................................... 21 Starting the Business Intelligence Platform ................................................................. 22 Starting the Administration Console............................................................................. 25
Page 2 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Introduction
License
This work is licensed under a Creative Commons Attribution 3.0 Australia License.
Donate
This tutorial is accessed by thousands on a monthly basis, from most of the feedback many found it extremely helpful! But contrary to belief I do not work for Pentaho and all of this work is voluntary, so even $1 can help me with producing bigger and better tutorials! You can donate to my PayPal account by clicking here.
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 MySQL 5.x PostgreSQL 8.x.x Oracle 10g & 11g Linux * MySQL 5.x * PostgreSQL 8.x.x Oracle 10g & 11g
* This tutorial is for Linux and MySQL 5.x setup.
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
Page 3 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux 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.
Page 4 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
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 terminal prompt: user@terminal:~# 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 Linux issue the following commands (seen in bold): Ubuntu user@terminal:~# sudo apt-get install sun-java6-jdk sun-java6-jre Fedora user@terminal:~# sudo su install sun-java6-jdk sun-java6-jre The next step is to check if the JAVA_HOME environment variable is setup correctly, issue the following command (seen in bold) at the terminal prompt: user@terminal:~# echo $JAVA_HOME /usr/lib/jvm/java-6-sun If a similar output (seen above) is displayed the JAVA_HOME environment variable is already setup. To setup the JAVA_HOME environment variable add this line to the bottom of the /etc/environment file: JAVA_HOME="/usr/lib/jvm/java-6-sun" 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 also add the following line to the bottom of the /etc/ environment file: CATALINA_OPTS="-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.
Page 5 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
The following directories should be visible after you have extracted the TAR file and moved its contents: opt/ |-- pentaho | |-- adminstration-console | |-- biserver-ce
The following directories should be visible after you have extracted the TAR file and moved its contents:
Page 6 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
opt/ |-- 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 directories 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 mysqlconnector-java-5.0.7.jar file to your tomcat's /common/lib directory. If not to copy the mysqlconnector-java-5.0.7.jar issue the following command (in bold) at the terminal prompt: Ubuntu user@terminal:~#/ sudo cp /opt/pentaho/biserver-ce/tomcat/common/lib/ mysql-connector-java-5.0.7.jar /opt/tomcat/common/lib Fedora user@terminal:~#/ su cp /opt/pentaho/biserver-ce/tomcat/common/lib/ mysql-connector-java-5.0.7.jar /opt/tomcat/common/lib webapps You will need to copy all the directories under the /opt/pentaho/biserver-ce/tomcat/webapps/ directory to the webapps/ directory under your existing Apache-Tomcat installation. To do so make sure you have stopped your Apache-Tomcat server then issue the following command (in bold) at the terminal prompt: Ubuntu user@terminal:~#/ sudo cp /opt/pentaho/biserver-ce/tomcat/webapps /opt/ tomcat/ Fedora user@terminal:~#/ su cp /opt/pentaho/biserver-ce/tomcat/webapps /opt/ tomcat/ Where /opt/tomcat/webapps/ is the location of your Apache-Tomcat webapps directory. You have just moved all the webapps which are needed by the Pentaho BI Platform (sw-styles is optional).
Page 7 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux The last step is to move the pentaho-solutions directory into the /pentaho/ directory or any other location which you would like to store all your pentaho solutions and configuration files. To move the pentahosolutions folder to the pentaho directory issue the following command (in bold) at the terminal prompt: Ubuntu user@terminal:~#/ sudo mv /opt/pentaho/biserver-ce/pentaho-solutions /opt/pentaho/ Fedora user@terminal:~#/ su mv /opt/pentaho/biserver-ce/pentaho-solutions /opt/ pentaho/ One more step will need to be done to make sure Pentaho knows the new location of the pentahosolutions directory which will be covered in the "Configuring Apache-Tomcat" section. The new structure of the pentaho-solutions and existing Apache-Tomcat directory looks like this: opt/ | |-- 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).
Page 8 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Now run the following command (in bold) to see if you have successfully created the hibernate, quartz and sampledata databases:
Page 9 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
mysql> show 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* authorities datasource granted_authorities users quartz qrtz_blob_triggers qrtz_calendars qrtz_cron_triggers qrtz_fired_triggers qrtz_job_details qrtz_job_listeners qrtz_locks qrtz_paused_trigger_grps qrtz_scheduler_state qrtz_simple_triggers qrtz_trigger_listeners qrtz_triggers sampledata customer_w_ter customers department_managers dim_time employees offices orderdetails orderfact orders payments products quadrant_actuals 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.
Page 10 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
applicationContext-spring-security-jdbc.xml
This file is located under the pentaho-solutions/system/ directory. 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/ directory. Once the file has opened locate this snippet of code:
Page 11 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
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/ directory. 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>
mysql5.hibernate.cfg.xml (optional)
This file is located under the pentaho-solutions/system/hibernate/ directory. 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.
Page 12 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 13 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
<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>
Page 14 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
pentaho-solutions location URL Disable HSQL database startup 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/ directory located under the /opt/biserver-ce/ directory 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 directory. By default this is set to /opt/biserver-ce/ pentaho/ directory. If you have decided to use an existing Apache-Tomcat server (or have moved your pentahosolutions directory) you will need to point this to where you have placed your pentaho-solutions directory. In this example my pentaho-solutions directory is under the /opt/pentaho/ directory, now my solution-path code snippet looks like this: <context-param> <param-name>solution-path</param-name> <param-value>/opt/pentaho/pentaho-solutions/</param-value> </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:
Page 15 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
<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>
Page 16 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux 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.
Page 17 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 18 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 19 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
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/ directory, 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.
Page 20 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 21 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 22 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
After logging in try and run a sample report from the Steel Wheels solution folder:
Page 23 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 24 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 25 of 26
Pentaho Business Intelligence Suite 3.7 A guide to getting started with MySQL 5.x and Linux
Page 26 of 26