1 簡介html
Pentaho是世界上最流行的開源商務智能軟件,以工做流爲核心的,強調面向解決方案而非工具組件的,基於java平臺的商業智能(Business Intelligence,BI)套件BI,之因此說是套件是由於它包括一個web server平臺和幾個工具軟件:報表,分析,圖表,數據集成,數據挖掘等,能夠說包括了商務智能的方方面面。它整合了多個開源項目,目標是和商業BI相抗衡。它偏向於與業務流程相結合的BI解決方案,側重於大 中型企業應用。它容許商業分析人員或開發人員建立報表,儀表盤,分析模型,商業規則和 BI 流程。java
注:以上感受高大上,但筆者比較鄙視Pentaho這個項目,從佈署的角度看,徹底沒有支撐該項目的標準文檔,只有零星的資料,要部署好只能靠反覆測試和摸索。mysql
2 實踐部分linux
2.1 環境部分git
2.1.1 運行環境github
IP Address = 10.168.0.76web
HostName = pentaho.cmdschool.orgspring
OS = CentOS 7.3sql
2.1.2 安裝輔助工具數據庫
yum install -y unzip
2.1.3 配置防火牆
firewall-cmd --permanent --add-port 8080/tcp firewall-cmd --reload firewall-cmd --list-all
2.2 MySQL配置
2.2.1 配置MySQL的源
vim /etc/yum.repos.d/mysql56-community.repo
輸入以下內容:
# Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/ enabled=1 gpgcheck=1 gpgkey=http://repo.mysql.com/RPM-GPG-KEY-mysql
2.2.2 安裝相關包
yum install -y mysql-community-server mysql-community-devel mysql-community-client
2.2.3 啓動並配置默認開機啓動
systemctl start mysqld systemctl enable mysqld
2.2.4 初始化數據庫
mysql_secure_installation
嚮導以下:
[...] Set root password? [Y/n] y New password: Re-enter new password: [...] Remove anonymous users? [Y/n] y [...] Disallow root login remotely? [Y/n] n [...] Remove test database and access to it? [Y/n] y [...] Reload privilege tables now? [Y/n] y [...]
2.3 Java配置
2.3.1 建立java目錄
mkdir /usr/java
2.3.2 下載JDK
cd /usr/java wget http://download.oracle.com/otn/java/jdk/8u121-b13/e9e7ea248e2c4826b92b3f075a80e441/jdk-8u121-linux-x64.tar.gz?AuthParam=1495873209_eea482e2b59774918c970cf5dc383fdb
2.3.3 解壓安裝包
tar -xf jdk-8u121-linux-x64.tar.gz
2.3.4 配置環境變量
vim /etc/profile
末尾加入以下內容:
export JAVA_HOME=/usr/java/jdk1.8.0_121 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
2.3.5 使環境變量生效
source /etc/profile
2.3.6 測試環境變量
java -version
2.4 Pentaho安裝包配置
2.4.1 下載程序包
mkdir /usr/pentaho cd /usr/pentaho wget https://nchc.dl.sourceforge.net/project/pentaho/Business%20Intelligence%20Server/7.0/pentaho-server-ce-7.0.0.0-25.zip wget https://nchc.dl.sourceforge.net/project/pentaho/Data%20Integration/7.0/pdi-ce-7.0.0.0-25.zip wget https://nchc.dl.sourceforge.net/project/pentaho/Report%20Designer/7.0/prd-ce-7.0.0.0-25.zip
注:下載連接,https://sourceforge.net/projects/pentaho/files/
2.4.2 解壓程序包
unzip pentaho-server-ce-7.0.0.0-25.zip unzip pdi-ce-7.0.0.0-25.zip unzip prd-ce-7.0.0.0-25.zip
2.4.3 更換mysql鏈接驅動
cd ~ wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.41.tar.gz tar -xf mysql-connector-java-5.1.41.tar.gz cp mysql-connector-java-5.1.41/mysql-connector-java-5.1.41-bin.jar /usr/pentaho/pentaho-server/tomcat/lib/ mv /usr/pentaho/pentaho-server/tomcat/lib/mysql-connector-java-5.1.17.jar ~/
注:下載連接,https://dev.mysql.com/downloads/connector/j/
2.4.4 修改Tomcat運行環境變量
vim /usr/pentaho/pentaho-server/tomcat/bin/setenv.sh
修改內容以下:
export JAVA_HOME=/usr/java/jdk1.8.0_121 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH export PENTAHO_JAVA_HOME=${JAVA_HOME} export INSTALL_HOME=/usr/pentaho/pentaho-server export DI_HOME=${INSTALL_HOME}/pentaho-solutions/system/kettle export CATALINA_OPTS="-Xms4096m -Xmx6144m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -DDI_HOME=$DI_HOME"
2.4.5 建立程序運行用戶
useradd -s /sbin/nologin -b /usr/pentaho
確認用戶家目錄
ls -ld /usr/pentaho
2.4.6 預配置esapi目錄
mkdir /usr/pentaho/esapi
2.4.7 配置目錄權限
chown -R pentaho:pentaho /usr/pentaho/ chmod -R 770 /usr/pentaho
2.5 數據庫服務配置
2.5.1 修改quartz庫的受權
vim /usr/pentaho/pentaho-server/data/mysql5/create_quartz_mysql.sql
註釋掉以下行:
# grant all on quartz.* to 'pentaho_user'@'localhost' identified by 'password';
2.5.2 修改hibernate庫的受權
vim /usr/pentaho/pentaho-server/data/mysql5/create_repository_mysql.sql
註釋掉以下行:
# GRANT ALL ON hibernate.* TO 'hibuser'@'localhost' identified by 'password';
2.5.3 修改jackrabbit庫的受權
vim /usr/pentaho/pentaho-server/data/mysql5/create_jcr_mysql.sql
註釋掉以下行:
# grant all on jackrabbit.* to 'jcr_user'@'localhost' identified by 'password';
2.5.4 導入數據庫
mysql -uroot -p < /usr/pentaho/pentaho-server/data/mysql5/create_quartz_mysql.sql mysql -uroot -p < /usr/pentaho/pentaho-server/data/mysql5/create_repository_mysql.sql mysql -uroot -p < /usr/pentaho/pentaho-server/data/mysql5/create_jcr_mysql.sql
2.5.5 配置數據庫權限
mysql -uroot -p grant all on quartz.* to 'pentaho'@'localhost' identified by 'passwd'; grant all on hibernate.* to 'pentaho'@'localhost' identified by 'passwd'; grant all on jackrabbit.* to 'pentaho'@'localhost' identified by 'passwd'; flush privileges;
2.5.6 測試數據庫
mysql -upentaho -ppasswd
2.6 遷移數據庫等配置
2.6.1 配置Quartz
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/quartz/quartz.properties pentaho-solutions/system/quartz/quartz.properties.default vim pentaho-solutions/system/quartz/quartz.properties
修改並啓用以下參數:
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate org.quartz.dataSource.myDS.jndiURL = Quartz
2.6.2 配置hibernate數據源
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/hibernate/mysql5.hibernate.cfg.xml pentaho-solutions/system/hibernate/mysql5.hibernate.cfg.xml.default vim pentaho-solutions/system/hibernate/mysql5.hibernate.cfg.xml
修改以下標籤參數:
<property name="connection.username">pentaho</property> <property name="connection.password">passwd</property>
2.6.3 配置Hibernate
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/hibernate/hibernate-settings.xml pentaho-solutions/system/hibernate/hibernate-settings.xml.default vim pentaho-solutions/system/hibernate/hibernate-settings.xml
修改以下標籤參數:
<config-file>system/hibernate/mysql5.hibernate.cfg.xml</config-file>
2.6.4 配置審計日誌
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/audit_sql.xml pentaho-solutions/system/audit_sql.xml.default cp pentaho-solutions/system/dialects/mysql5/audit_sql.xml pentaho-solutions/system/
2.6.5 配置repository.xml
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/jackrabbit/repository.xml pentaho-solutions/system/jackrabbit/repository.xml.default vim pentaho-solutions/system/jackrabbit/repository.xml
註解如下標籤和內容:
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> <param name="path" value="${rep.home}/repository"/> </FileSystem>
去掉如下標籤和內容註解並修改帳號密碼:
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="url" value="jdbc:mysql://localhost:3306/jackrabbit"/> <param name="user" value="pentaho"/> <param name="password" value="passwd"/> <param name="schema" value="mysql"/> <param name="schemaObjectPrefix" value="fs_repos_"/> </FileSystem>
註解如下標籤和內容:
<DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>
去掉如下標籤和內容註解並修改帳號密碼:
<DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore"> <param name="url" value="jdbc:mysql://localhost:3306/jackrabbit"/> <param name="user" value="pentaho"/> <param name="password" value="passwd"/> <param name="databaseType" value="mysql"/> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="minRecordLength" value="1024"/> <param name="maxConnections" value="3"/> <param name="copyWhenReading" value="true"/> <param name="tablePrefix" value=""/> <param name="schemaObjectPrefix" value="ds_repos_"/> </DataStore>
註解如下標籤和內容:
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> <param name="path" value="${wsp.home}"/> </FileSystem>
去掉如下標籤和內容註解並修改帳號密碼:
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="url" value="jdbc:mysql://localhost:3306/jackrabbit"/> <param name="user" value="pentaho"/> <param name="password" value="passwd"/> <param name="schema" value="mysql"/> <param name="schemaObjectPrefix" value="fs_ws_"/> </FileSystem>
註解如下標籤和內容:
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager"> <param name="url" value="jdbc:h2:${wsp.home}/db"/> <param name="schemaObjectPrefix" value="${wsp.name}_"/> </PersistenceManager>
去掉如下標籤和內容註解並修改帳號密碼:
<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager"> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="url" value="jdbc:mysql://localhost:3306/jackrabbit"/> <param name="user" value="pentaho" /> <param name="password" value="passwd" /> <param name="schema" value="mysql"/> <param name="schemaObjectPrefix" value="${wsp.name}_pm_ws_"/> </PersistenceManager>
註解如下標籤和內容:
<FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem"> <param name="path" value="${rep.home}/version" /> </FileSystem>
去掉如下標籤和內容註解並修改帳號密碼:
<FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="url" value="jdbc:mysql://localhost:3306/jackrabbit"/> <param name="user" value="pentaho"/> <param name="password" value="passwd"/> <param name="schema" value="mysql"/> <param name="schemaObjectPrefix" value="fs_ver_"/> </FileSystem>
註解如下標籤和內容:
<PersistenceManager class="org.apache.jackrabbit.core.persistence.pool.H2PersistenceManager"> <param name="url" value="jdbc:h2:${rep.home}/version/db"/> <param name="schemaObjectPrefix" value="version_"/> </PersistenceManager>
去掉如下標籤和內容註解並修改帳號密碼:
<PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.MySqlPersistenceManager"> <param name="driver" value="com.mysql.jdbc.Driver"/> <param name="url" value="jdbc:mysql://localhost:3306/jackrabbit"/> <param name="user" value="pentaho" /> <param name="password" value="passwd" /> <param name="schema" value="mysql"/> <param name="schemaObjectPrefix" value="pm_ver_"/> </PersistenceManager>
2.6.6 配置Tomcat的JDBC鏈接信息context.xml
cd /usr/pentaho/pentaho-server/ cp tomcat/webapps/pentaho/META-INF/context.xml tomcat/webapps/pentaho/META-INF/context.xml.default vim tomcat/webapps/pentaho/META-INF/context.xml
修如下配置:
maxWaitMillis="10000" username="pentaho" password="passwd" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/hibernate" validationQuery="select 1" /> maxWaitMillis="10000" username="pentaho" password="passwd" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/quartz" validationQuery="select 1"/>
2.6.7 配置web.xml
cd /usr/pentaho/pentaho-server cp tomcat/webapps/pentaho/WEB-INF/web.xml tomcat/webapps/pentaho/WEB-INF/web.xml.default vim 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] -->
2.6.8 配置applicationContext-spring-security-hibernate.properties(可選)
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/applicationContext-spring-security-hibernate.properties pentaho-solutions/system/applicationContext-spring-security-hibernate.properties.defautl vim pentaho-solutions/system/applicationContext-spring-security-hibernate.properties
修改以下參數:
jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/hibernate jdbc.username=pentaho jdbc.password=passwd hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
2.6.9 配置applicationContext-spring-security-jdbc.properties(可選)
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/applicationContext-spring-security-jdbc.properties pentaho-solutions/system/applicationContext-spring-security-jdbc.properties.default vim pentaho-solutions/system/applicationContext-spring-security-jdbc.properties
修改以下參數:
datasource.driver.classname=com.mysql.jdbc.Driver datasource.url=jdbc:mysql://localhost:3306/hibernate datasource.username=pentaho datasource.password=passwd datasource.validation.query=SELECT 1
2.6.10 配置jdbc.properties(可選)
cd /usr/pentaho/data-integration cp simple-jndi/jdbc.properties simple-jndi/jdbc.properties.default vim simple-jndi/jdbc.properties
註釋掉原來參數並增長以下參數且修改帳號密碼:
SampleData/type=javax.sql.DataSource SampleData/driver=com.mysql.jdbc.Driver SampleData/url=jdbc:mysql://localhost:3306/hibernate SampleData/user=pentaho SampleData/password=passwd Hibernate/type=javax.sql.DataSource Hibernate/driver=com.mysql.jdbc.Driver Hibernate/url=jdbc:mysql://localhost:3306/hibernate Hibernate/user=pentaho Hibernate/password=passwd Quartz/type=javax.sql.DataSource Quartz/driver=com.mysql.jdbc.Driver Quartz/url=jdbc:mysql://localhost:3306/quartz Quartz/user=pentaho Quartz/password=passwd Shark/type=javax.sql.DataSource Shark/driver=com.mysql.jdbc.Driver Shark/url=jdbc:mysql://localhost:3306/hbibernate Shark/user=pentaho Shark/password=passwd SampleDataAdmin/type=javax.sql.DataSource SampleDataAdmin/driver=com.mysql.jdbc.Driver SampleDataAdmin/url=jdbc:mysql://localhost:3306/hibernate SampleDataAdmin/user=pentaho SampleDataAdmin/password=passwd
2.6.11 配置pentaho.xml(可選)
cd /usr/pentaho/pentaho-server/ cp pentaho-solutions/system/pentaho.xml pentaho-solutions/system/pentaho.xml.defautl vim pentaho-solutions/system/pentaho.xml
修改以下配置:
<login-show-users-list>false</login-show-users-list> <login-show-sample-users-hint>false</login-show-sample-users-hint>
註解或刪除以下配置:
<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.7 測試和配置服務啓動
2.7.1 測試服務啓動
sudo -u pentaho /usr/pentaho/pentaho-server/tomcat/bin/startup.sh
2.7.2 監視日誌排錯
建議監控以下日誌:
tail -f /usr/pentaho/pentaho-server/tomcat/logs/catalina.out
建議搜索以下日誌:
grep -i -E "error|fail" /usr/pentaho/pentaho-server/tomcat/logs/catalina.out | sort -u
2.7.3 網頁測試
http://10.168.0.76:8080/pentaho
參閱資料:
=================================================
安裝教程:
https://help.pentaho.com/Documentation/7.0
其餘參考資料:
http://www.cnblogs.com/driftingshine/p/6065454.html
http://community.pentaho.com/
驅動下載連接:
http://www.oracle.com/technetwork/apps-tech/jdbc-112010-090769.html
http://www.oracle.com/technetwork/database/features/jdbc/jdbc-ucp-122-3110062.html
ojdbcx.jar, ora18n.jar
啓動安裝教程:
https://help.pentaho.com/Documentation/7.0/0D0/160/010#Oracle
LDAP項目:
https://help.pentaho.com/Documentation/7.0/0P0/Setting_Up_User_Security/Implement_Advanced_Security/010
https://help.pentaho.com/Documentation/7.0/0P0/Setting_Up_User_Security/Implement_Advanced_Security/030
下載頁面:
https://sourceforge.net/projects/pentaho/files/
手動LDAP配置:
https://help.pentaho.com/Documentation/7.0/0P0/Setting_Up_User_Security/Implement_Advanced_Security/030
http://diethardsteiner.github.io/biserver/2014/11/08/LDAP.html
切換到LDAP:
https://help.pentaho.com/Documentation/7.0/0P0/Setting_Up_User_Security/Implement_Advanced_Security/010
LDAP界面配置:
https://help.pentaho.com/Documentation/7.0/0P0/Setting_Up_User_Security/Implement_Advanced_Security/010
http://wiki.pentaho.com/display/ServerDoc2x/Using+LDAP+and+JDBC+Simultaneously
Jar下載:
http://mvnrepository.com/
安裝文檔:
https://help.pentaho.com/Documentation/7.0/0F0/0P0/Starting_the_Pentaho_Server_after_Manual_Installation
https://help.pentaho.com/Documentation/7.0/0F0/0P0/020/0B0
數據庫配置:
https://help.pentaho.com/Documentation/7.0/0F0/0P0/030/020