[PENTAHO] How to install Pentaho 5 with PostgreSQL on linux

Contate-nos

Publicado por: Marcello Bontempo Salgueiro
Ter, 30 Mai, 09:20

TAGS: Java, Linux, Pentaho, Tecnologia

Instalando TOMCAT:

Download tomcat:

cd /opt/

wget -c http://ftp.unicamp.br/pub/apache/tomcat/tomcat-8/v8.0.12/bin/apache-tomcat-8.0.12.zip

unzip apache-tomcat-8.0.12.zip

mv apache-tomcat-8.0.12.zip tomcat-8.0.12

 

Configure conf/tomcat-uses.xml

  <role rolename="manager-gui"/>
  <role rolename="manager-status"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="admin-gui" />
  <role rolename="PENTAHO_ADMIN"/>
  <user username="tomcat" password="<SENHA>" roles="manager-gui,manager-status,manager-script,manager-jmx,admin-gui"/>

 

Adicionar usuario tomcat:

groupadd tomcat

useradd -g tomcat -d /usr/local/tomcat tomcat

usermod -G www-data tomcat

chown tomcat:tomcat /opt/tomcat-8.0.12 -R

 

Instalando BISERVER CE:

Download Pentaho:

cd /opt/

wget -c http://superb-dca2.dl.sourceforge.net/project/pentaho/Business%20Intelligence%20Server/5.1/biserver-ce-5.1.0.0-752.zip

unzip biserver-ce-5.1.0.0-752.zip

mv biserver-ce/pentaho-solutions .

cd biserver-ce/tomcat/webapps/

cp -arf pentaho pentaho-style sw-style /opt/tomcat-8.0.12/webapps/

 

Configurando Pentaho com PostgreSQL:

cd /opt/tomcat-8.0.12/lib/

cp /opt/biserver-ce/tomcat/lib/postgresql-9.1-902.jdbc4.jar .

 

vim /opt/pentaho-solutions/system/applicationContext-spring-security-hibernate.properties

Código original:

1
2
3
4
5
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

Como deverá ficar:

1
2
3
4
5
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql://localhost:5432/hibernate
jdbc.username=hibuser
jdbc.password=<SENHA>
hibernate.dialect=org.hibernate.dialect.HSQLDialect

 

vim /opt/pentaho-solutions/system/hibernate/hibernate-settings.xml

Código original

1
<config-file>system/hibernate/hsql.hibernate.cfg.xml</config-file>
Como deverá ficar:
   <config-file>system/hibernate/postgresql.hibernate.cfg.xml</config-file>
vim /opt/pentaho-solutions/system/hibernate/postgresql.hibernate.cfg.xml

Código original:

    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="connection.username">hibuser</property>
    <property name="connection.password">password</property>

Como deverá ficar:

    <property name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <property name="connection.username">hibuser</property>
    <property name="connection.password"><SENHA></property>

 

vim /opt/tomcat-8.0.12/webapps/pentaho/META-INF/context.xml

Código original:


    <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="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:hsql://localhost/hibernate"
        validationQuery="select count(*) from INFORMATION_SCHEMA.SYSTEM_SEQUENCES" />
        
    <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="org.hsqldb.jdbcDriver" url="jdbc:hsqldb:hsql://localhost/quartz"
        validationQuery="select count(*) from INFORMATION_SCHEMA.SYSTEM_SEQUENCES"/>

Como deverá ficar:

    <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="<SENHA>"
        driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/hibernate"
        validationQuery="select 1" />
        
    <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="<SENHA>"
        driverClassName="org.postgresql.Driver" url="jdbc:postgresql://localhost:5432/quartz"
        validationQuery="select 1"/>

 

vim /opt/pentaho-solutions/system/simple-jndi/jdbc.properties

Código original:

SampleData/type=javax.sql.DataSource
SampleData/driver=org.hsqldb.jdbcDriver
SampleData/url=jdbc:hsqldb:hsql://localhost/sampledata
SampleData/user=pentaho_user
SampleData/password=password
Hibernate/type=javax.sql.DataSource
Hibernate/driver=org.hsqldb.jdbcDriver
Hibernate/url=jdbc:hsqldb:hsql://localhost/hibernate
Hibernate/user=hibuser
Hibernate/password=password
Quartz/type=javax.sql.DataSource
Quartz/driver=org.hsqldb.jdbcDriver
Quartz/url=jdbc:hsqldb:hsql://localhost/quartz
Quartz/user=pentaho_user
Quartz/password=password
Shark/type=javax.sql.DataSource
Shark/driver=org.hsqldb.jdbcDriver
Shark/url=jdbc:hsqldb:hsql://localhost/shark
Shark/user=sa
Shark/password=
SampleDataAdmin/type=javax.sql.DataSource
SampleDataAdmin/driver=org.hsqldb.jdbcDriver
SampleDataAdmin/url=jdbc:hsqldb:hsql://localhost/sampledata
SampleDataAdmin/user=pentaho_admin
SampleDataAdmin/password=password

Como deverá ficar:

Hibernate/type=javax.sql.DataSource
Hibernate/driver=org.postgresql.Driver
Hibernate/url=jdbc:postgresql://localhost:5432/hibernate
Hibernate/user=hibuser
Hibernate/password=<SENHA>
Quartz/type=javax.sql.DataSource
Quartz/driver=org.postgresql.Driver
Quartz/url=jdbc:postgresql://localhost:5432/quartz
Quartz/user=pentaho_user
Quartz/password=<SENHA>

Como removemos o SimpleData, que é um banco de demo, devemos agorar parar a inicialização do hibernate e a criação do SimpleData no Pentaho, para isso basta seguir os passos abaixo:

vim /opt/tomcat-8.0.12/webapps/pentaho/WEB-INF/web.xml

Código original:

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

  .......

  <filter>
    <filter-name>SystemStatusFilter</filter-name>
    <filter-class>org.pentaho.platform.web.http.filters.SystemStatusFilter</filter-class>
    <init-param>
      <param-name>initFailurePage</param-name>
      <param-value>InitFailure</param-value>
      <description>This page is displayed if the PentahoSystem fails to
        properly initialize.</description>
    </init-param>
  </filter>

  .....

  <filter-mapping>
    <filter-name>SystemStatusFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

 

Como deverá ficar:

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

<!--
  <filter>
    <filter-name>SystemStatusFilter</filter-name>
    <filter-class>org.pentaho.platform.web.http.filters.SystemStatusFilter</filter-class>
    <init-param>
      <param-name>initFailurePage</param-name>
      <param-value>InitFailure</param-value>
      <description>This page is displayed if the PentahoSystem fails to
        properly initialize.</description>
    </init-param>
  </filter>
-->

<!--
  <filter-mapping>
    <filter-name>SystemStatusFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
-->

 

Configurando o repositorio de arquivos para PostgreSQL (Jackrabbit):

Código original FileSystem:

  <!--
    .......
  <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
    <param name="driver" value="org.postgresql.Driver"/>
    <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="schema" value="postgresql"/>
    <param name="schemaObjectPrefix" value="fs_repos_"/>
  </FileSystem>
  -->

  <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
     <param name="path" value="${rep.home}/repository"/>
  </FileSystem>

Como deverá ficar FileSystem:


  <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
    <param name="driver" value="org.postgresql.Driver"/>
    <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="<SENHA>"/>
    <param name="schema" value="postgresql"/>
    <param name="schemaObjectPrefix" value="fs_repos_"/>
  </FileSystem>

<!--  <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
     <param name="path" value="${rep.home}/repository"/>
  </FileSystem>-->

 

Código original DataStore:

  <!--
   .....
  <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
    <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
    <param name="driver" value="org.postgresql.Driver"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="password"/>
    <param name="databaseType" value="postgresql"/>
    <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>
  -->

  <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>

 

Como deverá ficar DataStore:

  <DataStore class="org.apache.jackrabbit.core.data.db.DbDataStore">
    <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
    <param name="driver" value="org.postgresql.Driver"/>
    <param name="user" value="jcr_user"/>
    <param name="password" value="<SENHA>"/>
    <param name="databaseType" value="postgresql"/>
    <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>

<!-- <DataStore class="org.apache.jackrabbit.core.data.FileDataStore"/>  -->

 

Código original FileSystem WorkSpace:

<!--
    .......
    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="password"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="fs_ws_"/>
    </FileSystem>
    -->


    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
      <param name="path" value="${wsp.home}"/>
    </FileSystem>

Como deverá ficar FileSystem WorkSpace:


    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="<SENHA>"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="fs_ws_"/>
    </FileSystem>

<!-- <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
      <param name="path" value="${wsp.home}"/>
    </FileSystem> -->

 

Código original PersistenceManager:

    <!--
    .....
    <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="password"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="${wsp.name}_pm_ws_"/>
    </PersistenceManager>
    -->


    <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>

Como deverá ficar PersistenceManager:

    <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="<SENHA>"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="${wsp.name}_pm_ws_"/>
    </PersistenceManager>



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

Código original FileSystem Version:

    <!--
    ......
    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="password"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="fs_ver_"/>
    </FileSystem>
    -->


    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
      <param name="path" value="${rep.home}/version" />
    </FileSystem>


Como deverá ficar FileSystem Version:

    <!--
    <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="jcr_user"/>
      <param name="password" value="<SENHA>"/>
      <param name="schema" value="mysql"/>
      <param name="schemaObjectPrefix" value="fs_ver_"/>
    </FileSystem>

    <FileSystem class="org.apache.jackrabbit.core.fs.db.OracleFileSystem">
      <param name="url" value="jdbc:oracle:thin:@localhost:1521/XE"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="password"/>
      <param name="schemaObjectPrefix" value="fs_ver_"/>
      <param name="tablespace" value="jackrabbit"/>
    </FileSystem>

    -->
    <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem">
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="<SENHA>"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="fs_ver_"/>
    </FileSystem>

<!--    <FileSystem class="org.apache.jackrabbit.core.fs.local.LocalFileSystem">
      <param name="path" value="${rep.home}/version" />
    </FileSystem> -->

 

Código original PersistenceManager Version:

    <!--
     ........
    <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="password"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="pm_ver_"/>
    </PersistenceManager>
    -->

    <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>

Como deverá ficar PersistenceManager Version:


    <PersistenceManager class="org.apache.jackrabbit.core.persistence.bundle.PostgreSQLPersistenceManager">
      <param name="url" value="jdbc:postgresql://localhost:5432/jackrabbit"/>
      <param name="driver" value="org.postgresql.Driver"/>
      <param name="user" value="jcr_user"/>
      <param name="password" value="<SENHA>"/>
      <param name="schema" value="postgresql"/>
      <param name="schemaObjectPrefix" value="pm_ver_"/>
    </PersistenceManager>


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

 

Criando bancos no PostgreSQL:

Antes de tudo você poderá editar os arquivos: create_jcr_postgresql.sql, create_quartz_postgresql.sql, create_repository_postgresql.sql e auterar a senha dos usuários para a qual você queira definir.

cd /opt/biserver-ce/data/postgresql/

psql -h localhost -U postgres -W -f create_jcr_postgresql.sql

psql -h localhost -U postgres -W -f create_quartz_postgresql.sql

psql -h localhost -U postgres -W -f create_repository_postgresql.sql

 

Configurações extras no Pentaho 5.1.0:

Não sei porque mas na nova versão ele faz dependência a biblioteca do driver do Hibernate, assim basta coloca-lo na lib do tomcat:

cp /opt/biserver-ce/tomcat/lib/h2-1.2.131.jar /opt/tomcat-8.0.12/lib/

 

Adicione no /opt/tomcat-8.0.12/bin/startup.sh antes de exec "$PRGDIR"/"$EXECUTABLE" start "$@":

export CATALINA_OPTS="-Xms4096m -Xmx6144m -XX:MaxPermSize=256m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dpentaho.installed.licenses.file=$PENTAHO_INSTALLED_LICENSE_PATH"

 

 

Referências:

http://www.schenkels.nl/2013/12/how-to-install-and-configure-pentaho-bi-suite-5-ce-ubuntu-12-04-postgresql-9-2/

http://orkus.wordpress.com/2010/08/31/howto-install-tomcat-7-on-debian-lenny/

COMPARTILHE: Imagem de ComentarioTweetCompartilhe no facebookEnvie por email

Comentário desativado