As a programmer, when I encounter a tool like Mondrian I want to cry with joy. I want to sing (actually this is what I do) and dance from happiness. The reason is, it saves me a lot of time and frustration programming it by myself.
With Mondrian, all you have to do is describe what do you want to see and how and it will make the hard work for you.
Mondrian is an open source OLAP server which was developed by Pentaho and is free to use. All you need to do is download and install, learn how to use it and start rocking. The only problem is that installing Mondrian is a very, very unintuitive, frustrating task that is not well documented. You need to be very stubborn to succeed. The installation guide that Pentao provides does not reveal the whole picture and I had to hunt for information all over the web until I slowly managed to install it, hence I wrote this guide to shed some light on the task.
Two things before we start:
- I assume that you have already installed and are using mysql (otherwise why would you need OLAP for?) but in case you haven't, download and install Mysql
- I use Linux so i will write my examples for Linux.
OK, Lets start:
Mondrian was written in Java. If you don't have Java, download JDK and install it.
I have downloaded the RPM file. The command is : rpm -ivh rpm-file-name
Download Tomcat and Install tomcat.
I have downloaded the tar.gz file. the command is: tar -xzvf tar.gz-file
- Move Tomcat under /usr/local/tomcat
- Go to /usr/local/tomcat/bin. There you can find the files for activating and deactivating tomcat:
- ./startup.sh - activates
- ./shutdown.sh - dactivates
Run the ./startup.sh to activate tomcat.
- Download Mysql JDBC driver and unzip it.
- Verify that so far all installations were successful
- Test java : java - version
- Test mysql : mysql -V
- Test tomcat : If the ./startup.sh command went well you can go to the browser and type http://localhost:8080 and you will be able to see the tomcat welcome page which look like this :

- Download the last version of Mondrian and unzip it to /usr/local/mondrian. The result will be a new directory containing all Mondrian files. the name of directory will be mondrian-x.y.z.
Create mondrian directory under /usr/local/tomcat/webapps/ and move mondrian.war to there.
The result will look like this : /usr/local/tomcat/webapps/mondrian/mondrian.war
Explode mondrian.war
command : jar -xvf mondrian.war
- Move the JDBC connector jar file mysql-connector-java-[ver]-bin.jar under /usr/local/tomcat/webapps/mondrian/WEB-INF/lib
The next step will be to create the FoodMart mysql database for the example application.
use this commands:
- shell> mysql
- mysql> create database foodmart;
- mysql> create user "foodmart"@'yourhost' identified by "foodmart";
- mysql> grant all privileges on *.* to "foodmart"@'yourhost' identified by "foodmart";
Now, run the FoodMartLoader application to load the Foodmart database with data. It is important to pass the full path to all jar files and remove all spaces from the class path. Otherwise it fails for ClassNotFound or all kind of other errors.
command should look like this:
java -cp "/usr/local/tomcat/webapps/mondrian/WEB-INF/lib/mondrian.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/log4j-1.2.9.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/eigenbase-xom.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/eigenbase-resgen.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/eigenbase-properties.jar: /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/mysql-connector-java-5.1.5-bin.jar" mondrian.test.loader.MondrianFoodMartLoader -verbose -tables -data -indexes -jdbcDrivers=com.mysql.jdbc.Driver -inputFile=/usr/local/mondrian/demo/FoodMartCreateData.sql -outputJdbcURL="jdbc:mysql://localhost/foodmart?user=foodmart&password=foodmart"
- Copy xalan.jar to tomcat/common/endorsed.
command : cp /usr/local/tomcat/webapps/mondrian/WEB-INF/lib/xalan.jar /usr/local/tomcat/common/endorsed
- Go to /usr/local/tomcat/webapps/mondrian/WEB-INF and modify web.xml and datasources.xml files as appropriate. The driver value should be : JdbcDrivers=com.mysql.jdbc.Driver
- Go to /usr/local/tomcat/webapps/mondrian/WEB-INF/queries and modify all query files connect strings as appropriate.
- export CATALINA_OPTS='-Djava.awt.headless=true' or add to your shell profile, this stops tomcat dying when X-windows is not found.
Congratulations. Now you are ready to run mondrian. Point your browser to : http://localhost:8080/mondrian and you will get this screen:
I hope that this guide will make life easier for you. I also want to give credit to this blog which helped me a lot.
Here are some useful links which can help you start learning this world:
Good luck and enjoy the Mondrian magic.
and I thought my company's programmers were the only ones who sing about things like this... well, sing, and play flutes... programmers can be one crazy bunch