Pentaho 7.1 遷移到MySQL

環(huán)境:
CentOS 6.5
Pentaho壓縮包:pentaho-server-ce-7.1.0.0-12.zip
Java:java version "1.8.0_144" (64位)

工作目錄:/pentaho/pentaho-server
注:所有涉及到username和password的內(nèi)容都需要根據(jù)自己配置的數(shù)據(jù)庫(kù)修改

按照下面步驟依次修改文件:

  1. /pentaho/pentaho-server/pentaho-solutions/system/applicationContext-spring-security-jdbc.properties

datasource.driver.classname=com.mysql.jdbc.Driver
datasource.url=jdbc:mysql://localhost:3306/hibernate
datasource.username=root
datasource.password=root (根據(jù)自己的庫(kù)更改)
datasource.validation.query=SELECT USER()

  1. /pentaho/pentaho-server/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

  1. /pentaho/pentaho-server/pentaho-solutions/system/hibernate/hibernate-settings.xml

system/hibernate/mysql5.hibernate.cfg.xml

  1. /pentaho/pentaho-server/pentaho-solutions/system/quartz/quartz.properties

解除注釋并修改為: org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate

  1. /pentaho/pentaho-server/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

  1. /pentaho/pentaho-server/tomcat/webapps/pentaho/META-INF/context.xml

注釋掉所有的Resource,增加:
< 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()"/>

  1. /pentaho/pentaho-server/tomcat/webapps/pentaho/WEB-INF/web.xml

注釋掉以下兩段內(nèi)容
< !-- [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] -->

  1. 復(fù)查pentaho官方安裝文檔

  2. 復(fù)制驅(qū)動(dòng)包mysql-connector-java-5.1.44-bin.jar到:

/pentaho/pentaho-server/tomcat/lib

QA:
Q1. Pentaho日志目錄:/pentaho/pentaho-server/tomcat/logs
Q2. 問(wèn)題描述:
Error creating bean with name 'org.h2.tools.Server' defined in file [/pentaho/pentaho-server/pentaho-solutions/system/GettingStartedDB-spring.xml]: Invocation of init method failed; nested exception is org.h2.jdbc.JdbcSQLException: Exception opening port "H2 TCP Server (tcp://localhost:9092)" (port may be in use), cause: "timeout" [90061-131]

暫時(shí)解決方法:
在start-pentaho.sh中增加-Dh2.bindAddress=localhost,如:
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" -Dh2.bindAddress=localhost "

Q3. 報(bào)OPTION SQL_SELECT_LIMIT=5問(wèn)題

解決方法:換mysql-connector-java.jar,換成mysql-connector-java-5.1.44-bin.jar

Q4. 問(wèn)題描述:
[org.pentaho.platform.dataaccess.datasource.wizard.service.impl.ConnectionServiceImpl]ConnectionServiceImpl.ERROR_0002 - Unable to get the list of connections: DatasourceMgmtService.ERROR_0004 - Error occurred during retrieving the datasource

解決方法:先關(guān)閉BI Server(使用stop-pentaho.sh),然后刪除或改名如下文件夾/pentaho-solutions/system/jackrabbit/repository然后重啟BI Server(start-pentaho.sh)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容