安装JDK
Pentaho Server的安装使用需要安装jdk,并配置相关环境变量。
windows版本的jdk安装可参考文章:
http://blog.csdn.net/zzq900503/article/details/9770237
使用快捷键window+R输入cmd,输入java -version检查java环境如下:
Pentaho Bi平台包含了服务端和web管理控制台。
存放在https://sourceforge.net/projects/pentaho/files/ 的Business Intelligence Server栏目下
下载的包名格式为:
pentaho-server-ce-x.1.0.0-x.zip
pentaho-server-manual-ce-x.1.0.0-x.zip
pentaho-server内置了Pentaho BI服务器及管理控制台,带有manual的是自定义安装Pentaho BI平台,资深用户可能会使用到这一组件。
下载地址:
https://sourceforge.net/projects/pentaho/files/Business%20Intelligence%20Server/
选择相应的版本点击下载。
下载完成后解压即完成了安装。
解压如图:
pentaho sever自带了tomcat,点击start-pentaho.bat运行pentaho sever,等待启动完成如图。
可能出现的问题
启动控制台乱码。
在安装路径下找到start-pentaho.bat启动文件,我的路径是D:\pentaho\pentaho-server\start-pentaho.bat,用记事本打开编辑。 将
set CATALINA_OPTS=-Xms2048m -Xmx6144m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dfile.encoding=utf8 -DDI_HOME=%DI_HOME% 中的 utf8 修改成 GBK即可。
最终文本内容如下:
@echo off
setlocal
cd /D %~dp0
cscript promptuser.js //nologo //e:jscript
rem errorlevel 0 means user chose "no"
if %errorlevel%==0 goto quit
echo WScript.Quit(1); > promptuser.js
call set-pentaho-env.bat "%~dp0jre"
cd tomcat\bin
set CATALINA_HOME=%~dp0tomcat
SET BITS=64
SET DI_HOME="%~dp0pentaho-solutions\system\kettle"
set CATALINA_OPTS=-Xms2048m -Xmx6144m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dfile.encoding=GBK -DDI_HOME=%DI_HOME%
rem Make sure we set the appropriate variable so Tomcat can start (e.g. JAVA_HOME iff. _PENTAHO_JAVA_HOME points to a JDK)
if not exist "%_PENTAHO_JAVA_HOME%\bin\jdb.exe" goto noJdk
if not exist "%_PENTAHO_JAVA_HOME%\bin\javac.exe" goto noJdk
set JAVA_HOME=%_PENTAHO_JAVA_HOME%
set JRE_HOME=
goto start
:noJdk
rem If no JDK found at %_PENTAHO_JAVA_HOME% unset JAVA_HOME and set JRE_HOME so Tomcat doesn't misinterpret JAVA_HOME == JDK_HOME
set JAVA_HOME=
set JRE_HOME=%_PENTAHO_JAVA_HOME%
:start
call startup
:quit
endlocal
这个地方容易让人误解是tomcat8的问题然后去改tomcat8的配置文件发现没有效果,其实是pentaho在启动时重新给环境变量赋值了。
检测pentaho是否安装成功
在浏览器地址栏输入:localhost:8080 ,若能进入pentaho首页,则说明安装成功,如图:
点击Login as an Evaluator就可以看到用户名和密码
点击任意一个Go就能登陆主页面了
虽然pentaho server服务端已经启动成功了,但是有个问题需要解决。
我们发现在启动日志里发现使用的是HSQLDB。
Pentaho BI 服务器的很多重要信息存储在数据库中,其默认使用 HSQLDB 数据库,即借助它存储自身的资料库,比如 Quartz调度信息、业务资料库连
接信息(数据源)等。
HSQLDB是不能够支撑真实的企业应用的,生产环境必须替换它。就目前而言,Pentaho BI 服务器的资料库支持 HSQLDB、MySQL 5.x、 Oracle 10g、
Postgres 8.1.x 等 4 种数据库类型。值得注意的是, BI 服务器内部会借助 Hibernate 操作上述资料库表集合,因此它支持用户扩展使用其他数据
库类型,比如 DB2、 SQL Server。
pentaho report支持mongodb作为数据源进行分析mongodb中的数据,
pentaho kettle也可以对mongodb进行清洗和写入,可惜的是pentaho server暂时不支持使用mongodb作为数据库。
配置mysql数据库参考如下链接:
# For full set of properties see http://commons.apache.org/proper/commons-dbcp/configuration.html
# Please notice: this is only for Hypersonic. Update this for any other database you are using
# The fully qualified Java class name of the JDBC driver to be used
#datasource.driver.classname=org.hsqldb.jdbcDriver
datasource.driver.classname=com.mysql.jdbc.Driver
# The connection URL to be passed to our JDBC driver to establish a connection
#datasource.url=jdbc:hsqldb:hsql://localhost:9002/userdb
datasource.url=jdbc:mysql://localhost:3306/hibernate
# The connection username to be passed to our JDBC driver to establish a connection
#datasource.username=sa
datasource.username=hibuser
# The connection password to be passed to our JDBC driver to establish a connection
datasource.password=password
# The SQL query that will be used to validate connections from this pool before returning them to the caller.
# This query must be an SELECT statement that returns at least one row.
# HSQLDB: SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
# MySQL, H2, MS-SQL, POSTGRESQL, SQLite: SELECT 1
# ORACLE: SELECT 1 FROM DUAL
#datasource.validation.query=SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS
datasource.validation.query=SELECT USER()
# the maximum number of milliseconds that the pool will wait (when there are no available connections)
# for a connection to be returned before throwing an exception, or <= 0 to wait indefinitely. Default value is -1
datasource.pool.max.wait=-1
# The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. Default
value is 8
datasource.pool.max.active=8
# The maximum number of connections that can remain idle in the pool, without extra ones being destroyed, or negative for no limit.
Default value is 8
datasource.max.idle=4
# The minimum number of active connections that can remain idle in the pool, without extra ones being created when the evictor runs,
or 0 to create none. Default value is 0
datasource.min.idle=0
编辑D:\pentaho\pentaho-server\pentaho-solutions\system\applicationContext-spring-security-hibernate.properties
主要操作为把原配置注释,对应新增mysql的相关配置
地址端口和username和password需要与自己的mysql配置对应。
如图:
完整内容为:
#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=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hibernate
jdbc.username=hibuser
jdbc.password=password
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
编辑D:\pentaho\pentaho-server\pentaho-solutions\system\hibernate\hibernate-settings.xml
将配置里的路径hsql.hibernate.cfg.xml修改为mysql5.hibernate.cfg.xml,如图:
完整内容为:
xml version='1.0' encoding='utf-8'?>
--
* This setting allows the deployment to specify where to find the
* database-specific hibernate configuration. The samples supplied
* include the following:
*
* system/hibernate/hsql.hibernate.cfg.xml
* system/hibernate/mysql5.hibernate.cfg.xml
* system/hibernate/postgresql.hibernate.cfg.xml
* system/hibernate/oracle10g.hibernate.cfg.xml
* system/hibernate/sqlserver.hibernate.cfg.xml
*
-->
file>system/hibernate/mysql5.hibernate.cfg.xml file>
--
*
* managed should be set to true if running the BI Platform
* in a managed environment (like JBoss, Orion, etc). In this configuration,
* you should specify another location for the hibernate.cfg.xml (see below)
* instead of simply using the default one provided. This setting essentially
* tells the HibernateUtil class to use JNDI to locate the factory class for
* getting sessions. This allows the platform to use Hibernate across boundaries
* in message beans (for example).
*
false
-->
false
编辑D:\pentaho\pentaho-server\pentaho-solutions\system\hibernate\mysql5.hibernate.cfg.xml
主要操作是修改地址端口和username和password需要与自己的mysql配置对应。
完整内容为:
<hibernate-configuration>
<session-factory>
<property name="cache.provider_class">net.sf.ehcache.hibernate.SingletonEhCacheProviderproperty>
<property name="hibernate.generate_statistics">trueproperty>
<property name="hibernate.cache.use_query_cache">trueproperty>
<property name="connection.driver_class">com.mysql.jdbc.Driverproperty>
<property name="connection.url">jdbc:mysql://localhost:3306/hibernateproperty>
<property name="dialect">org.hibernate.dialect.MySQL5InnoDBDialectproperty>
<property name="connection.username">hibuserproperty>
<property name="connection.password">passwordproperty>
<property name="connection.pool_size">10property>
<property name="show_sql">falseproperty>
<property name="hibernate.jdbc.use_streams_for_binary">trueproperty>
<property name="hibernate.hbm2ddl.auto">updateproperty>
<mapping resource="hibernate/mysql5innodb.hbm.xml" />
session-factory>
hibernate-configuration>
编辑D:\pentaho\pentaho-server\pentaho-solutions\system\quartz\quartz.properties
主要操作去掉org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate之前的注释符号#号。
编辑D:\pentaho\pentaho-server\pentaho-solutions\system\simple-jndi\jdbc.properties
主要操作把地址端口驱动帐号密码修正跟自己的对应。
完整内容为:
# Copyright 2008 - 2010 Pentaho Corporation. All rights reserved.
# This program is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
# Foundation.
#
# You should have received a copy of the GNU Lesser General Public License along with this
# program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
# or from the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Lesser General Public License for more details.
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=root
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
编辑D:\pentaho\pentaho-server\tomcat\webapps\pentaho\META-INF\context.xml
主要操作把地址端口驱动帐号密码修正跟自己的对应。
完整内容为:
<Context path="/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 user()" />
<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 user()"/>
Context>
编辑D:\pentaho\pentaho-server\tomcat\webapps\pentaho\WEB-INF\web.xml
停用默认的HSqlDB,主要操作删除或者注释以下内容:
<context-param>
<param-name>hsqldb-databasesparam-name>
<param-
value>sampledata@../../data/hsqldb/sampledata,hibernate@../../data/hsqldb/hibernate,quartz@../../data/hsqldb/quartzparam-value>
context-param>
<listener>
<listener-class>org.pentaho.platform.web.http.context.HsqldbStartupListenerlistener-class>
listener>
```
如图部分:
![](http://image.525.life/FnMatDF5-NItI0MQg2_TjO0STEVo)
![](http://image.525.life/FgcwYT456ZUa0MKnXjJOqP9TksOA)
<h2>添加mysql驱动包h2>
复制mysql的渠道包到D:\pentaho\pentaho-server\tomcat\webapps\pentaho\WEB-INF\lib
[我们](http://my.525.life/article?id=1510739741935 "我们")这里使用的mysql驱动包是mysql-connector-java-5.1.37.jar。
我这里提供百度网盘的下载地址:
链接:https://pan.baidu.com/s/1eSlMWb4 密码:0arc
如图:
![](http://image.525.life/Fr87eMUTUb1yOthTcfgxZll05d7k)
<h2>重启检查是否迁移数据库成功h2>
重启pentaho检查是否迁移数据库成功。
点击start-pentaho.bat运行pentaho sever,等待启动完成如果不报错。
在浏览器地址栏输入:localhost:8080 ,若能进入pentaho首页,则说明迁移成功。
<h2>可能遇到的问题h2>
如图启动pentaho日志里报错,可以点击运行start-pentaho-debug.bat进行错误针对。
例如Could not resolve placeholder 'datasource.pool.max.wait' in string value "${datasource.pool.max.wait}" 说明缺少
datasource.pool.max.wait配置。
![](http://image.525.life/Fkb6hxnD008kYHhw7jY29uWk8QJg)
<h1>访问地址端口修改h1>
如果希望修改访问pentaho的地址和端口可以参考如下操作:
修改tomcat配置修改端口
在安装目录下找到并编辑/pentaho/server/pentaho-server/tomcat/conf/server.xml修改端口即可。
修改访问ip和地址
pentaho 6.0以及之前的版本
编辑D:\pentaho\pentaho-server\tomcat\webapps\pentaho\WEB-INF\web.xml
fully-qualified-server-url
http://localhost:8080/pentaho/
pentaho 6.0 以后的版本,包括7.1
在安装目录下找到并编辑pentaho/server/pentaho-server/pentaho-solutions/system/server.properties
fully-qualified-server-url=http://localhost:8080/pentaho/
“`
可以修改成能让外网访问或者域名访问。