author @fyunli
一、BI SERVER安装
安装JDK 1.6+
解压biserver-ce-5.1.0.0-752
启动start-pentaho.bat
-
访问BI SERVER
启动界面出现Pentaho BI平台服务器就绪后,浏览器打开
二、 迁移资料库到ORACLE
Pentaho bi server默认资料库存放在HSQL数据库中,对于小型应用可使用默认配置,对于企业应用则建议迁移到MYSQL, ORACLE等数据库。
PS: 以下文件目录以biserver-ce作为起始目录。
1、创建数据库
新建ORACLE数据库,假设为pentaho
使用biserver-ce\data\oracle10g目录内的sql文件创建表空间、用户名及数据表
sqlplus sys/password@pentaho as sysdba;
START create_jcr_ora;
conn sys/password as sysdba;
START create_quartz_ora;
conn sys/password as sysdba;
START create_repository_ora
2、将Oracle JDBC驱动ojdbc6-11.2.0.3.jar Copy到tomcat/lib目录
3、修改配置文件
3.1 配置Quartz
修改pentaho-solutions\system\quartz\quartz.properties
将原有内容:
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
替换成:
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
3.2 配置Hibernate
3.2.1 修改pentaho-solutions\system\applicationContext-spring-security-hibernate.properties
将原有内容:
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
替换成:
jdbc.driver=oracle.jdbc.OracleDriver
jdbc.url=jdbc:oracle:thin:@127.0.0.1:1521:PENTAHO
jdbc.username=hibuser
jdbc.password=password
hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
3.2.2 修改pentaho-solutions\system\hibernate\hibernate-settings.xml
将原有内容:
<config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file>
替换成:
<config-file>system/hibernate/oracle10g.hibernate.cfg.xml</config-file>
3.2.3 修改pentaho-solutions\system\hibernate\oracle10g.hibernate.cfg.xml
修改JDBC连接参数如下:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProvider</property>
<property name="hibernate.generate_statistics">true</property>
<property name="hibernate.cache.use_query_cache">true</property>
<!-- Oracle 10g Configuration -->
<property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@127.0.0.1:1521:PENTAHO</property>
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="connection.username">hibuser</property>
<property name="connection.password">password</property>
<property name="connection.pool_size">10</property>
<property name="show_sql">false</property>
<property name="hibernate.jdbc.use_streams_for_binary">true</property>
<!-- replaces DefinitionVersionManager -->
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- load resource from classpath -->
<mapping resource="hibernate/oracle10g.hbm.xml" />
</session-factory>
</hibernate-configuration>
3.3 替换默认Audit Log
用pentaho-solutions/system/dialects/oracle10g/audit_sql.xml 替换 pentaho-solutions/system/audit_sql.xml
3.4 配置JackRabbit
修改pentaho-solutions\system\jackrabbit\repository.xml
将
FileSystem、DataStore
Workspace\FileSystem、Workspace\PersistenceManager
Versioning\FileSystem、Versioning\PersistenceManager
几节的配置参数对应修改为Oracle,并修改tablespace原值JACKRABBIT为pentaho_tablespace
3.5 修改JNDI
3.5.1 tomcat\webapps\pentaho\META-INF\context.xml
将原有内容:
<?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>
替换成:
<?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="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@127.0.0.1:1521:PENTAHO"
validationQuery="select 1 from dual" />
<Resource name="jdbc/Quartz" auth="Container" type="javax.sql.DataSource"
factory="org.apache.commons.dbcp.BasicDataSourceFactory" maxActive="20" maxIdle="5"
maxWait="10000" username="quartz" password="password"
driverClassName="oracle.jdbc.OracleDriver" url="jdbc:oracle:thin:@127.0.0.1:1521:PENTAHO"
validationQuery="select 1 from dual"/>
</Context>
3.5.2 删除tomcat\conf\Catalina\localhost\pentaho.xml
3.6 修改tomcat\webapps\pentaho\WEB-INF\web.xml,停止HSQL启动
注释掉以下两段:
<!-- [BEGIN HSQLDB DATABASES] -->
<context-param>
<param-name>hsqldb-databases</param-name>
<param-value>sampledata@../../data/hsqldb/sampledata,hibernate@../../data/hsqldb/hibernate,quartz@../../data/hsqldb/quartz</param-value>
</context-param>
<!-- [END HSQLDB DATABASES] -->
<!-- [BEGIN HSQLDB STARTER] -->
<listener>
<listener-class>org.pentaho.platform.web.http.context.HsqldbStartupListener</listener-class>
</listener>
<!-- [END HSQLDB STARTER] -->
3.7 其他
迁移到其他数据库步骤类似,详情可见
4、处理bi-server自带实例库
Pentaho BI Server自带实例库数据存放在HSQL中,资料库转移后启动Pentaho BI Server因找不到数据会报错,只需删除实例库即可:
- 删除pentaho_solutions\system\default_content内容
- 删除pentaho_solutions\system\jackrabbit\repository目录