1、安装pentaho
下载好要安装的软件,如:biserver-ce-4.8.0-stable.tar.gz
创建安装目录,并将需要的文件解压至该目录下
使用:sudo mkdir /usr/local/pentaho
sudo tar –zxvf biserver-ce-4.8.0-stable.tar.gz –C /usr/local/pentaho/
进入pentaho目录将会得到,如下图所示的目录文件:
在biserver-ce目录下执行start-pentaho.sh,在administration-console目录下执行start-pac.sh, 分别启动user console与adminconsole,需要关闭执行相应的stop就可以完成。
注:此处执行start-pentaho.sh,如果出错可能是前面没设置默认jdk造成的
pentaho自带了tomcat,直接访问http://localhost:8080/pentaho 可以打开user console,访问http://localhost:8099可以打开admin console(初始化用户密码为:admin,password)。
2、将pentaho默认数据库迁移到mysql
进入mysql5目录
使用:cd biserver-ce/data/mysql5/
包含的sql脚本文件如下图所示(其中sampledata mysql.sql需要去下载):
修改create_sample_datasource_mysql.sql配置信息。
将其中的数据库的驱动、URL、Select语句修改成指定的数据库信息。
进入mysql数据库中
导入数据库的脚本使用下面命令。
使用:source 路径/脚本
如:source /usr/local/pentaho/biserver-ce/data/mysql5/create_repository_mysql.sql
依次导入到数据库中。
2.1、添加驱动
一般loalhost:8080/pentaho页面的404错误都是驱动引起的
下面的很重要:
在biserver-ce/tomcat/lib目录下添加mysql数据库驱动
在biserver-ce/tomcat/webapps/pentaho/WEB-INF/lib目录下添加mysql数据库驱动文件(此处没添也不要紧,需要时再添加吧,此文件在administration-console/jdbc目录中有)。
2.2、修改配置
修改下列目录配置文件数据库连接信息
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-jdbc.xml
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties
biserver-ce/pentaho-solutions/system/hibernate/hibernate-settings.xml
biserver-ce/pentaho-solutions/system/simple-jndi/jdbc.properties
biserver-ce/tomcat/webapps/pentaho/META-INF/context.xml
biserver-ce/tomcat/conf/Catalina/localhost/pentaho.xml
记住用户名和密码最好不要更改,更改了就要改mysql5.hibernate.cfg.xml的设置,这样就增加了工作量。
配置文件1
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-jdbc.xml
修改如下:
<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>
配置文件2
biserver-ce/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties
修改如下:
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hibernate
jdbc.username=hibuser
jdbc.password=password
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
配置文件3
biserver-ce/pentaho-solutions/system/hibernate/hibernate-settings.xml
修改如下:
<config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file>
配置文件4
biserver-ce/pentaho-solutions/system/simple-jndi/jdbc.properties
修改如下:
SampleData/type=javax.sql.Datasource
SampleData/driver=com.mysql.jdbc.Driver
SampleData/url=jdbc:mysql://localhost:3306/sampledata
SampleData/user=pentaho_user
SampleData/password=password
Hibernate/type=javax.sql.DataSource
Hibernate/driver=com.mysql.jdbc.Driver
Hibernate/url=jdbc:mysql://localhost:3306/hibernate
Hibernate/user=hibuser
Hibernate/password=password
Quartz/type=javax.sql.DataSource
Quartz/driver=com.mysql.jdbc.Driver
Quartz/url=jdbc:mysql://localhost:3306/quartz
Quartz/user=pentaho_user
Quartz/password=password
Shark/type=javax.sql.DataSource
Shark/driver=com.mysql.jdbc.Driver
Shark/url=jdbc:mysql://localhost:3306/shark
Shark/user=sa
Shark/password=
SampleDataAdmin/type=javax.sql.DataSource
SampleDataAdmin/driver=com.mysql.jdbc.Driver
SampleDataAdmin/url=jdbc:mysql://localhost:3306/sampledata
SampleDataAdmin/user=pentaho_admin
SampleDataAdmin/password=password
配置文件5
biserver-ce/tomcat/webapps/pentaho/META-INF/context.xml
修改如下:
<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"/>
配置文件6
biserver-ce/tomcat/conf/Catalina/localhost/pentaho.xml
修改如下:
<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"/>
补充:
1、4.8版本的pentaho发布功能默认是关闭的
需要修改biserver-ce/pentaho-solutions/system/publisher_config.xml
<publisher-config>
<publisher-password>设置你的密码</publisher-password>
</publisher-config>
2、确保别ip的都能连登录你的系统
修改biserver-ce/tomcat/webapps/pentaho/WEB-INF/web.xml
<context-param>
<param-name>base-url</param-name>
<param-value>http:你的ip:8080/pentaho</param-value>
</context-param>
参考文件:http://blog.csdn.net/luobailian/article/details/6331689
该类文章在网络上还是比较多的,我只是总结下认为自己所掌握的,如果想更深入了解pentaho,那就研读Pentaho源代码阅读报告,
这可以为你后面的源码编译工作带来极大的好处。