 
Pentahoの構築手順(インスール/基本設定)
■Pentahoとは| 機能 | |
|---|---|
| ダッシュボード | レポーティング | 
| インタラクティブ(対話型)分析 | データ統合/ETL(Extract/Transform/Load) | 
| データ・マイニング | |
・無償版の「コミュニティ・エディション」(CE)
・有償版の「エンタープライズ・エディション」(EE)
Pentahoのインストール
Pentahoユーザ作成
Pentahoを実行するOSユーザを作成する。またこのユーザでPentahoをインストールする。# groupadd -g 2000 pentaho # useradd -s /bin/bash -u 2000 -g pentaho pentaho
# passwd pentaho
Pentahoのインストーラ実行
Pentahoのインストーラを実行することで、BA用Tomcat、DI用Tomcat、PostgreSQLなどPentahoに必要なミドルウェア一式がインストールされる。# chmod ogu+x pentaho-business-analytics-5.1.0.0-752-x64.bin # mkdir /opt/app # chown pentaho -R /opt/app
# su - pentahopentahoのインストーラをTextモードで実行する。
| Pentahoベースディレクトリ | /opt/app/Pentaho | 
|---|---|
| DB管理者パスワード | password | 
$ ./pentaho-business-analytics-5.1.0.0-752-x64.bin --mode text Press [Enter] to continue : :省略 Do you accept the license? [y/n]:y : :省略 : [1] Default: Installs all Pentaho applications with predefined settings. [2] Custom: Choose the Pentaho applications you want installed and customize the server settings and password database administration access. Please choose an option [1] : 1 : :省略 : Location: [/opt/Pentaho]: /opt/app/Pentaho : :省略 : Please create a password for the administrator userid "postgres". Password: :password Confirm Password: :passwordインストール完了後、Pentahoが起動した状態になる。
Setup is now ready to begin installing the Pentaho applications on your computer. Press [Enter] to continue : Installing the Pentaho Business Analytics Enterprise Edition. Installation in Progress 0% ______________ 50% ______________ 100% Login to the Pentaho User Console using one of the following sample users: admin/password (Administrator) suzy/password (System User) To manage these sample users login to the Pentaho User Console. View Installation Summary [Y/n]: Y : :省略 : Launch the Pentaho User Console now. [Y/n]: n Pentaho Summary Selections/Settings: - PostgreSQL server port: 5432 - HSQL server port: 9001 - BA Server (Tomcat) startup port: 8080 - BA Server shutdown port: 8012 - Data Integration Server port: 9080 - Monet Database Port: 50006 - Embedded Database Port: 9092 - Reporting Design Tools: - Report Designer - Metadata Editor - Analysis Design Tools: - Schema Workbench - Aggregate Table Designer - Dashboard Designer - Data Integration (ETL) - Analyzer - Interactive Reporting - Mobile - Sample Content
Pentahoの運用設定
BAのTomcat設定
■AJPコネクトポート(8009)を設定(置き換え)# vi /opt/app/Pentaho/server/biserver-ee/tomcat/conf/server.xml
 <Connector URIEncoding="UTF-8" port="8023" maxThreads="150"
               enableLookups="false" redirectPort="8443" protocol="AJP/1.3"
               connectionTimeout="20000" useBodyEncodingForURI="true" />
# vi /opt/app/Pentaho/server/biserver-ee/tomcat/ctl.sh # vi /opt/app/Pentaho/server/biserver-ee/tomcat/scripts/ctl.sh
export JAVA_OPTS="-Dpentaho.installed.licenses.file=/opt/app/Pentaho/.installedLicenses.xml -Xms1024m -Xmx1024m  -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
※変更箇所は2箇所あるので注意。 # vi /opt/app/Pentaho/server/biserver-ee/tomcat/bin/catalina.sh
      #修正前
      #>> "$CATALINA_OUT" 2>&1 &
      #修正後
       2>&1 | /usr/sbin/rotatelogs "$CATALINA_OUT".%Y-%m-%d.log 86400 540 &
# vi /opt/app/Pentaho/server/biserver-ee/tomcat/conf/server.xml
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
       <!-- Tomcat Access log   追加 -->
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_BA_access_log." suffix=".log"
               pattern='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i" %D'  resolveHosts="false" />
     </Host>
DIのTomcat設定
DI用のTomcat設定をBA用と同様に設定変更を行う。# vi /opt/app/Pentaho/server/data-integration-server/scripts/ctl.sh
 export JAVA_OPTS="-Dpentaho.installed.licenses.file=/opt/app/Pentaho/.installedLicenses.xml -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.awt.headless=true"
# vi /opt/app/Pentaho/server/data-integration-server/tomcat/bin/catalina.sh
      #修正前
      #>> "$CATALINA_OUT" 2>&1 &
      #修正後
       2>&1 | /usr/sbin/rotatelogs "$CATALINA_OUT".%Y-%m-%d.log 86400 540 &
# vi /opt/app/Pentaho/server/data-integration-server/tomcat/conf/server.xml
      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true"
            xmlValidation="false" xmlNamespaceAware="false">
       <!-- Tomcat Access log   追加 -->
            <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_DI_access_log." suffix=".log"
               pattern='%h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i" %D'  resolveHosts="false" />
     </Host>
Apache設定
BA用Tomcatの8080ポートへHTTPアクセスすれば、Pentahoの操作は可能ですが、スマートではありません。本番稼働させるならば、Apache連携は必須だと思います。# vi /etc/httpd/conf/httpd.conf
 #Tomcat連携
    ProxyPass /pentaho ajp://localhost:8023/pentaho
    ProxyPassReverse /pentaho ajp://localhost:8023/pentaho
    ProxyPass /pentaho-style ajp://localhost:8023/pentaho-style
    ProxyPassReverse /pentaho-style ajp://localhost:8023/pentaho-style
# /etc/init.d/httpd restart※その他、/を/pentahoへリダイレクトしたほうが、親切かもしれません。
PostgreSQL設定
■ログディレクトリ作成# cd /opt/app/Pentaho # mkdir postgresql/data/pg_log # chown pentaho postgresql/data/pg_log
# vi /opt/app/Pentaho/postgresql/data/postgresql.conf
log_destination = 'stderr' logging_collector = on log_directory = 'pg_log log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log log_file_mode = 0600 log_truncate_on_rotation = off log_rotation_age = 1d log_min_messages = warning log_min_error_statement = error log_connections = on log_duration = on track_counts = on autovacuum = on
OracleJDBC設定
Oracleのデータに接続する必要がある場合は、OracleJDBCをインストールする。/opt/app/Pentaho/server/data-integration-server/tomcat/lib
/opt/app/Pentaho/design-tools/data-integration/lib
/opt/app/Pentaho/server/biserver-ee/tomcat/lib/
Pentaho自動起動設定
Pentahoの起動停止スクリプトは用意されているが、OS起動時に自動起動するスクリプトは用意されていないので、作成する。 ■自動起動スクリプト# vi /etc/init.d/pentaho_all
#!/bin/bash
#
# pentaho      This shell script takes care of starting and stopping Pentaho
#
# chkconfig: - 80 20
#
### BEGIN INIT INFO
# Provides: pentaho
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop:  0 1 6
# Description: Pentaho BI/DI server
# Short-Description: start and stop Pentaho
### END INIT INFO
# See how we were called.
RETVAL="0"
case "$1" in
    start)
        su - pentaho -c "/opt/app/Pentaho/ctlscript.sh start"
        ;;
    stop)
        su - pentaho -c "/opt/app/Pentaho/ctlscript.sh stop"
        ;;
    restart)
        su - pentaho -c "/opt/app/Pentaho/ctlscript.sh restart"
        ;;
    *)
        echo "Usage:$0 (start|stop|restart)"
      ;;
esac
exit $RETVAL
# chmod 755 /etc/init.d/pentaho_all
BA,DIのTomcat、PostgreSQLの再起動 # /etc/init.d/pentaho_all restart
#chkconfig --add pentaho_all・自動起動の確認
# chkconfig --list|grep pentaho pentaho_all 0:off 1:off 2:on 3:on 4:on 5:on 6:off
BI(ビジネスインテリジェンス)関連書籍
| ![[BIシステム構築実践入門 ]の書籍横断比較とレビュー](http://ecx.images-amazon.com/images/I/51W2TKD0PPL._SL75_.jpg)  | 
| ![[ビジネス・インテリジェンス―未来を予想するシナリオ分析の技法]の書籍横断比較とレビュー](http://ecx.images-amazon.com/images/I/41wXC%2BmlbtL._SL75_.jpg)  |  ビジネス・インテリジェンス―未来を予想するシナリオ分析の技法 | 
