pentaho bi server 配置MySQL數據庫


軟件版本:

jdk 1.7

MySQL 5.5

biserver-ce-6.1.0.1-196 (選擇右下方的所有選項See All Activities)

一、前置環境安裝

1、安裝jdk(略)

2、安裝MySQL

windows下安裝MySQL(略)

centos下在線安裝MySQL

在線安裝Mysql
    1°、查看mysql的依賴
        rpm -qa | grep mysql
    2°、刪除mysql的依賴
        rpm -e --nodeps `rpm -qa | grep mysql`
    3°、yum安裝mysql
        yum -y install mysql-server
    4°、啟動mysql服務
        service mysqld start
    5°、加入到開機啟動項
        chkconfig mysqld on
    6°、初始化配置mysql服務
        whereis mysql_secure_installation
        執行腳本/usr/bin/mysql_secure_installation
    7°、訪問mysql服務
        mysql -h localhost -uroot -proot
    問題:Host '192.168.10.1' is not allowed to connect to this MySQL server
    解決辦法:
        mysql> grant all privileges on *.* to 'root'@'%' identified by 'root';
        mysql> flush privileges;    
View Code

二、首次啟動(使用默認HSQLDB)

1、將下載好的壓縮包解壓到指定目錄

 

2、設置環境變量:PENTAHO_HOME

  計算機右擊“屬性”à“高級系統設置”—>“環境變量”à“新建”,按圖所示,根據自己機器實際情況添加環境變量,指向安裝好的JRE

3、啟動 bi  server 

雙擊 start-pentaho.bat,即可啟動server,首次啟動等待時間較長,成功啟動服務器后會有startup in ... s的提示。

啟動成功后訪問地址:http://localhost:8080/pentaho

 三、配置MySQL為默認數據庫

1、導入數據庫文件 (biserver-ce\data\mysql5目錄)

create_jcr_mysql.sql

create_quartz_mysql.sql       :為Quartz計划任務器創建資源庫。

create_repository_mysql.sql :創建hibernate 數據庫,用於存儲用戶授權認證,solution repository以及數據源。

※在版本中缺少了sample_data腳本,可以從5.4之前的版本的包中找到。

2、添加MySQL驅動

復制mysql的驅動包到  /opt/ptools/biserver-ce/tomcat/lib/ 目錄下

復制mysql的驅動包到 \biserver-ce\tomcat\webapps\pentaho\WEB-INF\lib

3、biserver-ce/pentaho-solutions/system 目錄下

(1) pentaho.xml 

關閉前台顯示用戶列表
<login-show-users-list>false</login-show-users-list>

注釋測試數據

<!--
<sampledata-datasource>
     <name>SampleData</name>
     <host>localhost</host>
     <type>Hypersonic</type>
     <port>9001</port>
     <access>NATIVE</access>
     <username>pentaho_user</username>
     <password>password</password>
     <max-active>20</max-active>
     <max-idle>5</max-idle>
     <max-wait>1000</max-wait>
     <query>select count(*) from INFORMATION_SCHEMA.SYSTEM_SEQUENCES</query>
</sampledata-datasource> -->

(2)applicationContext-spring-security-jdbc.properties

注釋HSQLDB 配置 ,新增MySQL 配置

datasource.driver.classname=com.mysql.jdbc.Driver
datasource.url=jdbc:mysql://localhost:3306/hibernate
datasource.username=root
datasource.password=root
datasource.validation.query=SELECT USER()

(3)applicationContext-spring-security-hibernate.properties

注釋HSQLDB 配置 ,新增MySQL 配置

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/hibernate
jdbc.username=hibuser
jdbc.password=password
hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect

(4)\biserver-ce\pentaho-solutions\system\hibernate\hibernate-settings.xml 

修改配置文件為 MySQL 配置

<config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file>

(5)\biserver-ce\pentaho-solutions\system\quartz\quartz.properties

org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate

(6)\biserver-ce\pentaho-solutions\system\simple-jndi\jdbc.properties

注釋HSQL 配置,添加MySQL配置

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

(7)\biserver-ce\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="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>

(8)\biserver-ce\tomcat\webapps\pentaho\WEB-INF\web.xml

<!-- [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] -->

4、啟動bi Server,打開瀏覽器,http://localhost:8080/pentaho/

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM