Guia Penta Ho

34
PENTAHO BUSINESS INTELLIGENCE SUITE 4.5 UNA GUIA PARA COMENZAR CON POSTGRESQL 9.1 Y GNU/LINUX OMAR CABRERA ROSERO UNIVERSIDAD DE NARI ˜ NO FACULTAD DE INGENIER ´ IA PROGRAMA DE INGENIER ´ IA DE SISTEMAS SAN JUAN DE PASTO 2012

Transcript of Guia Penta Ho

Page 1: Guia Penta Ho

PENTAHO BUSINESS INTELLIGENCE SUITE 4.5UNA GUIA PARA COMENZAR CON POSTGRESQL 9.1 Y

GNU/LINUX

OMAR CABRERA ROSERO

UNIVERSIDAD DE NARINOFACULTAD DE INGENIERIA

PROGRAMA DE INGENIERIA DE SISTEMASSAN JUAN DE PASTO

2012

Page 2: Guia Penta Ho

You are free:

to Share – to copy, distribute and transmit thiswork

to Remix – to adapt this work

Under the following conditions:

Attribution – You must attribute the work in themanner specified by the author or licensor (but notin any way that suggests that they endorse you oryour use of the work)

Share Alike – If you alter, transform, or buildupon this work, you may distribute the resultingwork only under the same or similar license to thisone.

Subject to conditions outlined in the license.

This work is licensed under the Creative Commons Attribution-ShareAlike 3.0

Unported License. To view a copy of this license, visit

http://creativecommons.org/licenses/by-sa/3.0/

or send a letter to Creative Commons, 171 Second Street, Suite 300, San Fran-

cisco, California, 94105, USA.

Page 3: Guia Penta Ho

CONTENIDO

1. Comenzando Instalacion 7

1.1. Instalacion Java de Oracle 7

1.2. Instalacion y configuracion de PostgreSQL 9.1 Server 8

2. Implementacion de la plataforma 11

2.1. PostgreSQL Java Conector 11

2.2. SQL Script Pack 12

3. Configurando la Base de Datos 13

3.1. Extraer el paquete de scripts para postgreSQL 13

3.2. Cargando los scritps SQL 13

4. Configurando Seguridad JDBC 16

4.1. applicationContext-spring-security-jdbc.xml 16

4.2. applicationContext-spring-security-hibernate.properties 17

4.3. hibernate-settings.xml 17

4.4. postgresql.hibernate.cfg.xml (opcional) 18

Page 4: Guia Penta Ho

5. Configurar Hibernate y Quartz 19

5.1. context.xml y pentaho.xml 19

5.2. quartz.properties 20

6. Configurar servidor Apache-Tomcat 21

6.1. solution-path 21

6.2. fully-qualified-server-url 22

6.3. Deshabilitar base de datos HSQL al inicio 22

6.4. TrustedIpAddrs 23

6.5. Otros parametros 24

7. Configurando SMTP (servidor de correo) 25

8. Configurando publicacion 27

9. Configuracion de la consola de administracion 28

10.Cuenta de Usuario 29

11.Iniciar la Plataforma Pentaho BI 30

12.Iniciar la Plataforma Pentaho BI Automaticamente 32

13.Iniciar la consola de Administracion 34

Page 5: Guia Penta Ho

INTRODUCCION

Pentaho BI Platform Community Edition (CE), proporciona la arquitectura y la infra-

estructura necesarios para crear soluciones para problemas de inteligencia de negocios

(BI). El framework proporciona servicios basicos como la autenticacion, registro, audi-

torıa, servicios web y motores de reglas. La plataforma tambien incluye un motor de

solucion que integra la presentacion de informes, analisis, cuadros de mando y los com-

ponentes de minerıa de datos. El diseno modular y basado en arquitectura de plugin

permite que toda o parte de la plataforma sea embebida en aplicaciones de terceros por

los usuarios finales, ası como OEMs.

La aplicacion mas conocida de la Plataforma de BI es el Pentaho BI server que fun-

ciona como sistema manejador de reportes basado en la web el informe, el servidor de

integracion de aplicaciones y el motor de flujo de trabajo ligero (secuencias de accion.)

Esta disenado para facil integracion en cualquier proceso de negocio.

Community Edition es un software libre de codigo abierto soportado. La Enterprise

Edition (EE) de la Pentaho BI plataform esta disponible como parte de la Pentaho BI

Suite EE que incluye soporte tecnico, manejador de actualizaciones y caracterısticas de

la empresa. Para obtener mas informacion acerca de la EE o para demos y hojas de

datos, podemos visitar Pentaho BI Suite EE en el sitio corporativo de Pentaho 1.

Para usar esta guia se considera que el lector tiene conociemintos intermedios y avan-

zados en su configuracion de eleccion y conocimientos basicos de Pentaho (aunque no

es necesario). Los siguientes sistemas operativos y base de datos son soportados:

1http://www.pentaho.com/products/

Page 6: Guia Penta Ho

Windows

• MySQL

• PostgreSQL

• Oracle

GNU/Linux

• MySQL

• PostgreSQL

• Oracle

Esta guia es para configurar Pentaho BI Server 4.5.0 en GNU/Linux y PostgreSQL 9.1,

parte de esta guia esta basada en la guia realizada por Prashant Raju 2 y el libro de

Roland Boumen y Jos van Dongen 3

2http://www.prashantraju.com/projects/pentaho/3Pentaho Solutions: Business Intelligence and Data Warehousing with Pentaho and MySQL

Page 7: Guia Penta Ho

1 Comenzando Instalacion

1.1. Instalacion Java de Oracle

Pentaho BI requiere de una JVM (Java Virtual Machine) instalada en su PC o servidor.

Para comprobar si Java esta instalado se ejecuta el siguiente comando en la terminal:

$ java −ve r s i onjava ve r s i on ‘ ‘ 1 . 7 . 0 07 ’ ’Java (TM) SE Runtime Environment ( bu i ld 1 . 7 . 0 07−b10 )Java HotSpot (TM) 64−Bit Server VM ( bu i ld 23.3−b01 , mixed mode)

Si muestra una salida similar a la anterior Java ya esta instalado. Si no, instale Java en

GNU/Linux siguiendo los pasos siguientes:

Lo primero que se tiene que hacer es descargar el JDK, el cual se lo puede encontrar

en: http://www.oracle.com se acepta la licencia y dependiendo de la arquitectura del

sistema se descarga el archivo jdk-7u7-linux-i586.tar.gz para plataforma x86 o jdk-7u7-

linux-x64.tar.gz para plataforma x64.

Luego el archivo descargado se lo copia a la carpeta opt y se lo descomprime de la

siguiente forma en la terminal:

$ su# cp jdk−7u7−l inux−x64 . t a r . gz / opt# tar x v f jdk−7u7−l inux−x64 . t a r . gz

Se cambia el nombre a la carpeta que se descomprimio

# mv jdk1 . 7 . 0 07 jvm

7

Page 8: Guia Penta Ho

Luego se ejecutan los siguientes comandos

# update−a l t e r n a t i v e s −− i n s t a l l ‘ ‘/ usr / b in / java ’ ’ ‘ ‘ java ’ ’ ‘ ‘/ opt /jvm/ j r e / b in / java ’ ’ 1

# update−a l t e r n a t i v e s −− i n s t a l l ‘ ‘/ usr / b in / java ’ ’ ‘ ‘ java ’ ’ ‘ ‘/ opt /jvm/ bin / java ’ ’ 1

# update−a l t e r n a t i v e s −− i n s t a l l ‘ ‘/ usr / b in / javac ’ ’ ‘ ‘ javac ’ ’ ‘ ‘/ opt/jvm/ bin / javac ’ ’ 1

# update−a l t e r n a t i v e s −− i n s t a l l ‘ ‘/ usr / b in / javaws ’ ’ ‘ ‘ javaws ’ ’ ‘ ‘/opt /jvm/ bin / javaws ’ ’ 1

# update−a l t e r n a t i v e s −−con f i g java

El siguiente paso es configurar la variable de entorno JAVA HOME, para eso se agregan

las siguientes lineas en el archivo /etc/environment:

JAVA HOME=“/opt/jvm”

JRE HOME=“/opt/jvm/jre”

Ahora para comprobar si la variable de entorno quedo bien configurada, se ejecuta el

siguiente comando en la terminal:

$ echo $JAVA HOME $JRE HOME/ opt /jvm / opt/jvm/ j r e

Si muestra una salida similar a la anterior, la variable de entorno JAVA HOME esta

configurada correctamente.

1.2. Instalacion y configuracion de PostgreSQL 9.1 Server

Para la instalacion de PostgreSQL 9.1 (Para Debian/Linux), en una terminal se ejecuta

los siguiente:

$ su# apt−ge t i n s t a l l p o s t g r e s q l p o s t g r e s q l−c l i e n t p o s t g r e s q l−con t r i b

pgadmin3

Ahora se borra la contrasena para la cuenta de adminitrador de “postgres” para ello se

ejecuta lo siguiente en la linea de comandos.

8

Page 9: Guia Penta Ho

# su po s t g r e s −c p s q l t empla te1

template1=# ALTER USER pos tg r e s WITH PASSWORD ‘ pos tg r e s1 ’ ;template1=#\q

Eso altera la contrasena dentro de la base de datos, ahora se tiene que hacer lo mismo

para el usuario ’postgres’ y colocar la misma contrasena que utilizo anteriormente.

# passwd −d po s t g r e s#su po s t g r e s −c passwd

Para configurar el paquete de administracion de PostgreSQL que permite un mejor re-

gistro y supervision dentro de pgAdmin se ejecuta lo siguiente en la terminal.

# su po s t g r e s −c p s q l < /usr / share / p o s t g r e s q l /9.1/ ex t ens ion /adminpack−−1.0. s q l

Para poder acceder y utilizar el servidor de forma remota se debe editar el archivo

postgresql.conf

nano / e tc / p o s t g r e s q l /9 .1/ main/ p o s t g r e s q l . conf

Al final del archivo agregamos las siguientes lineas:

listen addresses = ’*’

password encryption = on

Ahora se debe definir quien puede acceder al servidor, para ello se modifica el archivo

pg hba.conf.

nano / e tc / p o s t g r e s q l /9 .1/ main/pg hba . conf

9

Page 10: Guia Penta Ho

Debe quedar algo similar a lo siguiente:

# DO NOT DISABLE!# I f you change t h i s f i r s t en try you w i l l need to make sure# tha t the # database# super user can access the database us ing some other method .# Nonin t e rac t i v e# access to a l l da tabases i s r e qu i r ed during automatic# maintenance # ( autovacuum , d a i l y cronjob , r e p l i c a t i o n ,# and s im i l a r t a s k s ) .## Database admin i s t r a t i v e l o g i n by UNIX soc k e t slocal a l l po s t g r e s md5# TYPE DATABASE USER CIDR−ADDRESS METHOD

# ” l o c a l ” i s f o r Unix domain socke t connec t ions on lylocal a l l a l l md5# IPv4 l o c a l connect ions :host a l l a l l 1 2 7 . 0 . 0 . 1 / 3 2 md5# IPv6 l o c a l connect ions :host a l l a l l : : 1 / 1 2 8 md5

# Connections f o r a l l PCs on the subnet## TYPE DATABASE USER IP−ADDRESS IP−MASK METHODhost a l l a l l [ ip address ] [ subnet mask ] md5

En la ultima lınea, agrega su mascara de subred (por ejemplo, 255.255.255.0) y la

direccion IP de la maquina que usted desea tener acceso a su servidor (por ejemplo,

192.168.1.104). Sin embargo, si usted desea permitir el acceso a un rango de direcciones

IP, Se sustituye el ultimo numero por un cero y todas las maquinas dentro de ese rango

se permitira el acceso (por ejemplo, 192.168.1.0 permitirıa a todos los equipos con una

direccion IP 192.168.1.X para usar el servidor de base de datos).

Ya por ultimo se reinicia el servidor:

# / e t c / i n i t . d/ p o s t g r e s q l r e s t a r t

10

Page 11: Guia Penta Ho

2 Implementacion de la plataforma

Hay muchas maneras de implementar la plataforma, con Apache-Tomcat que viene con

el archivo de instalacion del servidor Pentaho BI o con un servidor existente Apache-

Tomcat.

En esta guıa se impletentara con el servidor Apache-Tomcat que viene con el servidor

de Pentaho BI, para ello primero se descarga el archivo “biserver-ce-4.5.0-stable.tar.gz”

desde http://sourceforge.net/projects/pentaho/

Se crea el directorio /opt/pentaho, en esta carpeta se mueve el archivo descargado y se

lo extrae de la siguiente manera en la terminal:

$ su# mkdir / opt /pentaho# mv b i s e r v e r−ce−4.5.0− s t a b l e . t a r . gz / opt /pentaho# cd / opt /pentaho# tar x v z f b i s e r v e r−ce−4.5.0− s t a b l e . t a r . gz

Los siguientes directorios pueden ser visibles luego de extraer el arcivo tar.gz

opt/

• pentaho/

◦ administration-console

◦ biserver-ce

2.1. PostgreSQL Java Conector

Para colocar el conector JDBC se procede a descargar el archivo “postgresql-9.2-1002.jdbc4.jar”

en el directorio “/opt/pentaho/biserver-ce/tomcat/lib” para ello se ejecuta lo siguiente

en la terminal:

11

Page 12: Guia Penta Ho

# cd /opt /pentaho/ b i s e r v e r−ce/ tomcat/ l i b# wget h t t p :// jdbc . p o s t g r e s q l . org /download/ po s t g r e s q l −9.2−1002.

jdbc4 . j a r

2.2. SQL Script Pack

Un paquete de scripts SQL es un conjunto de secuencias de comandos SQL para confi-

gurar todas las bases de datos necesarias. El paquete de scripts SQL para PostgreSQL

se lo puede descargar aquı.

12

Page 13: Guia Penta Ho

3 Configurando la Base de Datos

3.1. Extraer el paquete de scripts para postgreSQL

Despues de descargar el paquete los scripts SQL para PostgreSQL se tienen que extraer

los archivos en una ubicacion temporal. Estas son los cinco scripts SQL que deben ser

visibles despues de que el paquete ha sido extraıdos:

1 create repository postgresql.sql: Crea la base de datos Hibernate.

2 create quartz postgresql.sql: Crea la base de datos de cuarzo.

3 create sample datasource postgresql.sql: Carga los datos de ejemplo de fuente

de datos en la base de datos Hibernate.

4 load sample users postgresql.sql: Crea todos los usuarios de ejemplo y roles en

la base de datos Hibernate.

5 sample data postgresql.sql: Crea la base de datos de datos de ejemplo.

Los scripts anteriores se deben cargar en el orden en que se enumeran. Cargue estos

scripts SQL utilizando la consola de PostgreSQL.

3.2. Cargando los scritps SQL

Antes de empezar, asegurese de que coloca todos los scripts SQL en el directorio que

iniciara la sesion en la consola de PostgreSQL, en este caso /home/pentaho/tmp/.

Luego para ejecutar los scritps en una terminal ejecutamos:

13

Page 14: Guia Penta Ho

# cd /home/pentaho/tmp# p s q l −−username=pos t g r e s −f 1 c r e a t e r e p o s i t o r y p o s t g r e s q l . s q lPassword for user po s tg r e s :. . . outputPassword for user h ibuse r : [ en te r ‘ ‘ password ’ ’ ]# ps q l −−username=pos t g r e s −f 2 c r e a t e q u a r t z p o s t g r e s q l . s q lPassword for user po s tg r e s :. . . outputPassword for user pentaho user : [ en te r ‘ ‘ password ’ ’ ]# ps q l −−username=pos t g r e s −f 3 c r e a t e s amp l e d a t a s o u r c e p o s t g r e s q l

. s q lc r e a t e s a m p l e d a t a s o u r c e p o s t g r e s q l . s q lPassword for user po s tg r e s :Password for user h ibuse r : [ en te r ‘ ‘ password ’ ’ ]. . . output# ps q l −−username=pos t g r e s −f 4 l o a d s amp l e u s e r s p o s t g r e s q l . s q lPassword for user po s tg r e s :Password for user h ibuse r : [ en te r ‘ ‘ password ’ ’ ]. . . output# ps q l −−username=pos t g r e s −f 5 s amp l e d a t a p o s t g r e s q l . s q lPassword for user po s tg r e s :. . . output

Ejecutando los anteriores scripts se crean tres base de datos hibernate, quartz y sam-

pledata con las siguientes tablas:

hibernate 1

L i s t o f r e l a t i o n sSchema | Name | Type | Owner−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−+−−−−−−−+−−−−−−−−−

pub l i c | a u t h o r i t i e s | t a b l e | h ibuse rpub l i c | datasource | t a b l e | h ibuse rpub l i c | g r a n t e d a u t h o r i t i e s | t a b l e | h ibuse rpub l i c | use r s | t a b l e | h ibuse r

1Hibernate crea nuevas tablas en la base de datos hibernate despues de que la plataforma PentahoBI inicia por primera vez.

14

Page 15: Guia Penta Ho

quartz

L i s t o f r e l a t i o n sSchema | Name | Type | Owner−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−−−−−−+−−−−−−−+−−−−−−−−−−−−−−

pub l i c | q r t z b l o b t r i g g e r s | t a b l e | pentaho userpub l i c | q r t z c a l e n d a r s | t a b l e | pentaho userpub l i c | q r t z c r o n t r i g g e r s | t a b l e | pentaho userpub l i c | q r t z f i r e d t r i g g e r s | t a b l e | pentaho userpub l i c | q r t z j o b d e t a i l s | t a b l e | pentaho userpub l i c | q r t z j o b l i s t e n e r s | t a b l e | pentaho userpub l i c | q r t z l o c k s | t a b l e | pentaho userpub l i c | q r t z p a u s e d t r i g g e r g r p s | t a b l e | pentaho userpub l i c | q r t z s c h e d u l e r s t a t e | t a b l e | pentaho userpub l i c | q r t z s i m p l e t r i g g e r s | t a b l e | pentaho userpub l i c | q r t z t r i g g e r l i s t e n e r s | t a b l e | pentaho userpub l i c | q r t z t r i g g e r s | t a b l e | pentaho user

sampledata

L i s t o f r e l a t i o n sSchema | Name | Type | Owner−−−−−−−−+−−−−−−−−−−−−−−−−−−−−−+−−−−−−−+−−−−−−−−−−

pub l i c | customer w ter | t a b l e | pos tg r e spub l i c | customers | t a b l e | pos tg r e spub l i c | department managers | t a b l e | pos tg r e spub l i c | employees | t a b l e | pos tg r e spub l i c | o f f i c e s | t a b l e | pos tg r e spub l i c | o r d e r d e t a i l s | t a b l e | pos tg r e spub l i c | o r d e r f a c t | t a b l e | pos tg r e spub l i c | orde r s | t a b l e | pos tg r e spub l i c | payments | t a b l e | pos tg r e spub l i c | products | t a b l e | pos tg r e spub l i c | quadrant ac tua l s | t a b l e | pos tg r e spub l i c | time | t a b l e | pos tg r e spub l i c | t r i a l b a l a n c e | t a b l e | pos tg r e s

15

Page 16: Guia Penta Ho

4 Configurando Seguridad JDBC

En esta seccion se describe como configurar la seguridad de la plataforma Pentaho

BI JDBC que se utiliza en el servido PostgreSQL, esto significa que la plataforma de

Pentaho BI ahora apuntara a la base de datos hibernate en el servidor PostgreSQL en

lugar del paquete de la base de datos HSQL.

4.1. applicationContext-spring-security-jdbc.xml

Este archivo esta esta localizado en el directorio pentaho-solutions/system/.

Una vez abierto el archivo se localiza este fragmento de codigo:

< !−− This i s on ly f o r Hypersonic . P lease update t h i s s e c t i on f o rany o ther database you are us ing −−>

<bean id = ‘ ‘ dataSource ’ ’ c l a s s = ‘ ‘ org . springframework . jdbc . datasource. DriverManagerDataSource ’ ’>

<property name= ‘ ‘ driverClassName ” value = ‘ ‘ org . hsqldb . jdbcDriver ’ ’/>

<property name= ‘ ‘ ur l ’ ’ va lue = ‘ ‘ j d b c : h s q l d b : h s q l : // l o c a l h o s t : 9 0 0 1 /hibernate ’ ’ />

<property name= ‘ ‘ username ’ ’ va lue = ‘ ‘ h ibuser ’ ’ /><property name= ‘ ‘ password ’ ’ va lue = ‘ ‘ password ’ ’ />

</bean>

Se realizan algunos cambios en la seccion y el codigo debe ser similar al siguiente:

16

Page 17: Guia Penta Ho

< !−− This i s on ly f o r Hypersonic . P lease update t h i s s e c t i on f o rany o ther database you are us ing −−>

<bean id = ‘ ‘ dataSource ’ ’ c l a s s = ‘ ‘ org . springframework . jdbc . datasource. DriverManagerDataSource ’ ’>

<property name= ‘ ‘ driverClassName ’ ’ va lue = ‘ ‘ org . p o s t g r e s q l . Dr iver ’’ />

<property name= ‘ ‘ u r l ’ ’ va lue = ‘ ‘ j d b c : p o s t g r e s q l : // l o c a l h o s t : 5 4 3 2 /h ibe rnate ’ ’ />

<property name= ‘ ‘ username ’ ’ va lue = ‘ ‘ h ibuse r ’ ’ /><property name= ‘ ‘ password ’ ’ va lue = ‘ ‘ password ’ ’ />

</bean>

4.2. applicationContext-spring-security-hibernate.properties

Este archivo esta esta localizado en el directorio pentaho-solutions/system/

Una vez abierto el archivo se localiza este fragmento de codigo:

jdbc . d r i v e r=org . hsqldb . jdbcDr iverjdbc . u r l=jdbc : hsqldb : hsq l : // l o c a l h o s t :9001/ h ibe rnatejdbc . username=hibuse rjdbc . password=passwordh ibernate . d i a l e c t=org . h ibe rnate . d i a l e c t . HSQLDialect

Se realizan algunos cambios en la seccion y el codigo debe ser similar al siguiente:

jdbc . d r i v e r=org . p o s t g r e s q l . Dr iverjdbc . u r l=jdbc : p o s t g r e s q l : // l o c a l h o s t :5432/ h ibe rnatejdbc . username=hibuse rjdbc . password=passwordh ibernate . d i a l e c t=org . h ibe rnate . d i a l e c t . PostgreSQLDialect

4.3. hibernate-settings.xml

Este archivo esta esta localizado en el directorio pentaho-solutions/system/hibernate/

Una vez abierto el archivo se localiza este fragmento de codigo:

17

Page 18: Guia Penta Ho

<con f i g− f i l e>system/ h ibe rnate / hsq l . h ibe rnate . c f g . xml</ con f i g− f i l e>

Se realizan algunos cambios en la seccion y el codigo debe ser similar al siguiente:

<con f i g− f i l e>system/ h ibe rnate / p o s t g r e s q l . h ibe rnate . c f g . xml</ con f i g−f i l e>

4.4. postgresql.hibernate.cfg.xml (opcional)

Este archivo esta esta localizado en el directorio pentaho-solutions/system/hibernate/

No se tiene que realizar ningun cambio en este archivo si desea utilizar el usuario

hibuser por defecto (que fue creado con el archivo 4 load sample users postgresql.sql).

Sin embargo, si usted desea especificar su propio usuario buscar y cambiar las siguientes

dos lıneas de codigo:

<property name= ‘ ‘ connect ion . username ’ ’>h ibuse r</ property><property name= ‘ ‘ connect ion . password ’ ’>password</ property>

Realice los cambios con un nombre de usuario y la contrasena de su eleccion.

18

Page 19: Guia Penta Ho

5 Configurar Hibernate y Quartz

Hibernate y Quartz necesitan especificame usar las bases de datos hibernate y quartz

que se crean en el servidor PostgreSQL.

5.1. context.xml y pentaho.xml

Estos archivos se encuentra en el directorio /tomcat/webapps/pentaho/META-INF/ y

/conf/Catalina/localhost/ respectivamente y tienen el mismo contenido.

Una vez abiertos los archivos se localiza este fragmento de codigo:

<?xml version= ‘ ‘1 .0 ’ ’ encoding = ‘ ‘UTF−8 ’ ’ ?><Context path = ‘ ‘/ pentaho ’ ’ docbase = ‘ ‘webapps/pentaho/ ’ ’>

<Resource name= ‘ ‘ jdbc / Hibernate ’ ’ auth = ‘ ‘ Container ’ ’ type = ‘ ‘ javax. s q l . DataSource ’ ’

f a c t o r y = ‘ ‘ org . apache . commons . dbcp . BasicDataSourceFactory ’ ’maxActive = ‘ ‘20 ’ ’ maxIdle = ‘ ‘5 ’ ’

maxWait= ‘ ‘10000 ’ ’ username = ‘ ‘ h ibuse r ’ ’ password = ‘ ‘ password ’ ’driverClassName = ‘ ‘ org . hsqldb . jdbcDr iver ’ ’ u r l = ‘ ‘

j d b c : h s q l d b : h s q l : // l o c a l h o s t / h ibe rnate ’ ’va l idat ionQuery = ‘ ‘ s e l e c t count (∗ ) from INFORMATION SCHEMA.

SYSTEM SEQUENCES ’ ’ />

<Resource name= ‘ ‘ jdbc /Quartz ’ ’ auth = ‘ ‘ Container ’ ’ type = ‘ ‘ javax .s q l . DataSource ’ ’

f a c t o r y = ‘ ‘ org . apache . commons . dbcp . BasicDataSourceFactory ’ ’maxActive = ‘ ‘20 ’ ’ maxIdle = ‘ ‘5 ’ ’

maxWait= ‘ ‘10000 ’ ’ username = ‘ ‘ pentaho user ’ ’ password = ‘ ‘ password’ ’

driverClassName = ‘ ‘ org . hsqldb . jdbcDr iver ’ ’ u r l = ‘ ‘j d b c : h s q l d b : h s q l : // l o c a l h o s t / quartz ’ ’

va l idat ionQuery = ‘ ‘ s e l e c t count (∗ ) from INFORMATION SCHEMA.SYSTEM SEQUENCES ’ ’ />

</Context>

Se realizan algunos cambios en la seccion y el codigo debe ser similar al siguiente:

19

Page 20: Guia Penta Ho

<?xml version= ‘ ‘1 .0 ’ ’ encoding = ‘ ‘UTF−8 ’ ’ ?><Context path = ‘ ‘/ pentaho ’ ’ docbase = ‘ ‘webapps/pentaho/ ’ ’>

<Resource name= ‘ ‘ jdbc / Hibernate ’ ’ auth = ‘ ‘ Container ’ ’ type = ‘ ‘ javax. s q l . DataSource ’ ’

f a c t o r y = ‘ ‘ org . apache . commons . dbcp . BasicDataSourceFactory ’ ’maxActive = ‘ ‘20 ’ ’ maxIdle = ‘ ‘5 ’ ’

maxWait= ‘ ‘10000 ’ ’ username = ‘ ‘ h ibuse r ’ ’ password = ‘ ‘ password ’ ’driverClassName = ‘ ‘ org . p o s t g r e s q l . Dr iver ’ ’ u r l = ‘ ‘

j d b c : p o s t g r e s q l : // l o c a l h o s t : 5 4 3 2 / h ibe rnate ’ ’va l idat ionQuery = ‘ ‘ s e l e c t 1 ’ ’ />

<Resource name= ‘ ‘ jdbc /Quartz ’ ’ auth = ‘ ‘ Container ’ ’ type = ‘ ‘ javax .s q l . DataSource ’ ’

f a c t o r y = ‘ ‘ org . apache . commons . dbcp . BasicDataSourceFactory ’ ’maxActive = ‘ ‘20 ’ ’ maxIdle = ‘ ‘5 ’ ’

maxWait= ‘ ‘10000 ’ ’ username = ‘ ‘ pentaho user ’ ’ password = ‘ ‘ password’ ’

driverClassName = ‘ ‘ org . p o s t g r e s q l . Dr iver ’ ’ u r l = ‘ ‘j d b c : p o s t g r e s q l : // l o c a l h o s t : 5 4 3 2 / quartz ’ ’

va l idat ionQuery = ‘ ‘ s e l e c t 1 ’ ’ /></Context>

5.2. quartz.properties

Un cambio adicional se necesita hacer para conseguir trabajar PostgreSQL con quartz

para ello se abre el archivo quartz.properties que se encuentra en el directorio / pentaho-

solutions/system/.

Buscar el siguiente fragmento de codigo:

#org . quar t z . j o bS to r e . d r i v e rDe l e ga t eC l a s s =

Se realizan algunos cambios y el codigo debe ser similar al siguiente:

org . quartz . j obStore . d r i v e rDe l ega t eC la s s = org . quartz . impl .j d b c j o b s t o r e . PostgreSQLDelegate

20

Page 21: Guia Penta Ho

6 Configurar servidor Apache-Tomcat

Para configurar los ajustes del servidor Apache-Tomcat para la plataforma Pentaho

BI, la mayorıa de los cambios se realizan en el archivo web.xml que se encuentra en el

directorio tomcat/webapps/pentaho/WEB INF/.

Usted puede configurar los siguientes elementos (y mas) para la plataforma Pentaho

BI:

pentaho-solutions location

URL

Deshabilitar base de datos HSQL al inicio

TrustedIpAddrs n(opcional - para la consola de administracion y si se esta acce-

diendo al servidor remoto)

Si esta satisfecho con la siguiente configuracion para el servidor Pentaho BI usted no

tendra que realizar ningun cambio en el archivo.

6.1. solution-path

El parametro solution-path permite a la Plataforma de Pentaho BI saber donde localizar

el directorio pentaho-solutions. Por defecto se establece en el directorio /opt/biserver-

ce/pentaho/.

Se realizan algunos cambios y el codigo debe ser similar al siguiente:

<context−param><param−name>s o lu t i on−path</param−name><param−value>/ opt /pentaho/pentaho−s o l u t i o n s /</param−value>

</ context−param>

21

Page 22: Guia Penta Ho

6.2. fully-qualified-server-url

Si esta satisfecho cuando visita la URL http://localhost:8080/pentaho para acceder a

la plataforma Pentaho BI no necesita cambiar este parametro, sin embargo si usted

desea que otros accedan al sitio (de forma remota o en una red) usted necesita realizar

cambios en este parametro.

Buscar el siguiente fragmento de codigo:

<param−value> h t t p : // l o c a l h o s t : 8 0 8 0 /pentaho/ </ param−value>

Se realizan algunos cambios y el codigo debe ser similar al siguiente:

<param−value> h t t p : //www. pagina . com:8080/pentaho/ </ param−value>

o

<param−value> h t t p : //192 . 168 . 1 . 100 :8080 /pentaho/ </ param−value>

6.3. Deshabilitar base de datos HSQL al inicio

Por defecto con la base de datos HSQL inicia automaticamente, para prevenir esto se

localizan estos fragmentos de codigo:

< !−− [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<$

</context−param>< !−− [END HSQLDB DATABASES] −−>

22

Page 23: Guia Penta Ho

< !−− [BEGIN HSQLDB STARTER] −−>< l i s t e n e r>

< l i s t e n e r −c l a s s>Sta r tupL i s t ene rorg . pentaho . p lat form . web . http . context . Hsq ldbStartupLis tener</

l i s t e n e r −c l a s s></ l i s t e n e r>< !−− [END HSQLDB STARTER] −−>

Se realizan algunos cambios y los codigos debe ser similares a los siguientes:

< !−− [BEGIN HSQLDB DATABASES] −−>< !−− <context−param>

<param−name>hsq ldb−da tabases</param−name><param−value>sampledata@ . . / . . / data / h s q l d b / sampledata ,

hibernate@ . . / . . / data / h s q l d b / h ibernate , quartz@ . . / . . / data /h s q l d b / quar t z<$

</context−param> −−>< !−− [END HSQLDB DATABASES] −−>

< !−− [BEGIN HSQLDB STARTER] −−>< !−− < l i s t e n e r>

< l i s t e n e r −c l a s s>S ta r tupL i s t ene rorg . pentaho . p la t form . web . h t t p . con t ex t . Hsq l d bS ta r tupL i s t ene r</

l i s t e n e r −c l a s s></ l i s t e n e r> −−>< !−− [END HSQLDB STARTER] −−>

6.4. TrustedIpAddrs

Si desea acceder a su servidor Apache-Tomcat remotamente por lo que en el paso

anterior no ha especificado localhost o 127.0.0.1 para el parametro de base-url - usted

tendra que agregar la direccion IP de su servidor Apache-Tomcat a esta lista.

Abra el archivo y localice esta lınea de codigo:

Buscar el siguiente fragmento de codigo:

<param−name>TrustedIpAddrs</param−name><param−value>1 2 7 . 0 . 0 . 1</param−value>

23

Page 24: Guia Penta Ho

Se realizan algunos cambios y los codigos debe ser similares a los siguientes:

<param−name>TrustedIpAddrs</param−name><param−value>1 2 7 . 0 . 0 . 1 , [ y o u r i p a d d r e s s ]</param−value>

Esto permitira a la administracion de la consola Pentaho hacer ’ping’ al servidor para

ver si es hacia arriba o abajo, no es necesario hacer esto si tu hosting es servidor local.

6.5. Otros parametros

Tambien puede cambiar el idioma local y pais en el archivo web.xml, los cambios en

estos parametros se explica por sı mismo.

24

Page 25: Guia Penta Ho

7 Configurando SMTP (servidor de correo)

Para configurar la plataforma Pentaho BI para utilizar un servidor SMTP (servidor de

correo) que se utilizara para enviar informes por correo electronico, se necesitan hacer

modificaciones al archivo /pentaho-solutions/system/smtp-email/email config.xml.

Estos son los parametros disponibles que se pueden configurar para que soporte SMTP:

mail.smtp.host: Esta es la direccion de su servidor de correo electronico SMTP para

el envıo de correo electronico por ejemplo: smtp.gmail.com.

mail.smtp.port: Este es el puerto de su servidor de correo electronico SMTP, para

GMail es el 587.

mail.transport.protocol: El transporte para acceder al servidor de correo. Usual-

mente es smtp, para GMail es smtps.

mail.smtp.starttls.enable: Si el servidor SMTP utiliza autenticacion TTLS coloca-

mos ese parametro en ‘true’, para GMail es ‘true’.

mail.smtp.auth: Colocar en ‘true’ si el remitente del servidor de correo requiere au-

tentificarse.

mail.smtp.ssl: Se coloca en ‘true’ si el servidor de correo electronico requiere una

conexion SSL, para GMail es ‘true’.

mail.debug: Salida de informacion de depuracion de la API JavaMail.

mail.pop3: No se esta utilizando.

mail.from.default: La direccion de los correos electronicos de la plataforma Pentaho

BI por ejemplo, [email protected].

mail.userid: El ID de usuario que se utiliza para autenticar con el servidor SMTP,

mail.smtp.auth se debe establecer en ‘true’.

25

Page 26: Guia Penta Ho

mail.password: La contrasena que se utiliza para autenticar con el servidor SMTP,

mail.smtp.auth se debe establecer en ‘true’.

El siguiente es un ejemplo del archivo smtp-email.xml configurado para GMail:

<email−smtp><p r o p e r t i e s>

<mail . smtp . host>smtp . gmail . com</ mail . smtp . host><mail . smtp . port>587</ mail . smtp . port><mail . t r an spo r t . p ro to co l>smtps</ mail . t r anspor t . p ro to co l><mail . smtp . s t a r t t l s . enable>t rue</ mail . smtp . s t a r t t l s . enable><mail . smtp . auth>t rue</ mail . smtp . auth><mail . smtp . s s l>t rue</ mail . smtp . s s l><mail . smtp . qu i twa i t> f a l s e</ mail . smtp . qu i twa i t>

</ p r o p e r t i e s><mail . pop3></ mail . pop3><mail . from . default>ejemplo@gmail . com</ mail . from . default><mail . u s e r i d>ejemplo@gmail . com</ mail . u s e r i d><mail . password>password</ mail . password>

</ email−smtp>

26

Page 27: Guia Penta Ho

8 Configurando publicacion

Por defecto publicacion no esta habilitada, para habilitarla debera especificar una con-

trasena que debera ser utilizada para publicar. Para comenzar se tiene que editar

el archivo publisher config.xml que se encuentra ubicado en el directorio /pentaho-

solutions/system/

Una vez abierto el archivo se localiza este fragmento de codigo:

<pub l i she r−c o n f i g><pub l i she r−password></ pub l i she r−password>

</ pub l i she r−c o n f i g>

Se ingresa un password entre la etiquetas publisher-password (esta contrasena sera la

misma para todos los usuarios). El codigo debe quedar similar al siguiente (en este caso

la contrasena es ’password’):

<pub l i she r−c o n f i g><pub l i she r−password>password</ pub l i she r−password>

</ pub l i she r−c o n f i g>

A partir de ahora, cuando un usuario intenta publicar contenido en la plataforma Pen-

taho BI se tendra que especificar la contrasena.

27

Page 28: Guia Penta Ho

9 Configuracion de la consola de administracion

Para configurar la Consola de administracion de PostgreSQL se tiene que descargar el

driver JDBC para PostgreSQL.

Para colocar el conector JDBC se procede a descargar el archivo “postgresql-9.2-1002.jdbc4.jar”

en el directorio “/administration-console/jdbc/”, para ello se ejecuta lo siquiente en la

terminal:

# cd /opt /pentaho/ admin i s t ra t ion−conso l e / jdbc /# wget h t t p :// jdbc . p o s t g r e s q l . org /download/ po s t g r e s q l −9.2−1002.

jdbc4 . j a r

28

Page 29: Guia Penta Ho

10 Cuenta de Usuario

Por razones de seguridad, se debe considerar la creacion de un usuario independiente

cuenta para ejecutar las aplicaciones del servidor, como Pentaho. Normalmente, la cuen-

ta de usuario puede tambien ser dueno del directorio que contiene el software. Ademas,

esta cuenta de usuario podrıa ser bloqueada del resto del sistema. Esto es una cuestion

de errores: un bug en el software o un servidor simplemente hackeado no puede hacer

ningun dano fuera de su propio directorio del software, es decir, la cuenta de usuario

reservado para Pentaho no tiene ningun permiso fuera del arbol del directorio Pentaho.

Para configurar un cuenta de usuario, grupo, en una terminal se ejecuta lo siguiente:

# addgroup pentahoAdding group ’ p e n t a h o (GID 1001) . . .

# adduser −−system −−ingroup pentaho −−d i sab l ed−l o g i n pentahoAdding system user ’ p e n t a h o (UID 115) . . .Adding new user ’ p e n t a h o (UID 115) with group ’ p e n t a h o . . .Creat ing home d i r e c t o r y ’/home/ p e n t a h o . . .

Ahora se cambia de dueno a la carpeta Pentaho, en una terminal se ejecuta lo siguiente:

# chown pentaho : pentaho −R /opt /pentaho

29

Page 30: Guia Penta Ho

11 Iniciar la Plataforma Pentaho BI

Para iniciar la plataforma Pentaho BI en una terminal se ejecuta el siguiente comando

“start-pentaho.sh” que se encuentra en el directorio /opt/pentaho/biserver-ce de la si-

guiente manera en la terminal:

# cd /opt /pentaho/ b i s e r v e r−ce# sudo −u pentaho ./ s t a r t−pentaho . sh/ opt /pentaho/ b i s e rv e r−ce/ opt /pentaho/ b i s e rv e r−ceWARNING: Using java from pathDEBUG: PENTAHO JAVA HOME=DEBUG: PENTAHO JAVA=javaUsing CATALINA BASE: / opt /pentaho/ b i s e rv e r−ce /tomcatUsing CATALINA HOME: / opt /pentaho/ b i s e rv e r−ce /tomcatUsing CATALINA TMPDIR: / opt /pentaho/ b i s e rv e r−ce /tomcat/tempUsing JRE HOME: / usrUsing CLASSPATH: / opt /pentaho/ b i s e rv e r−ce /tomcat/ bin /

boots t rap . j a r

Nota: 1

Ahora ya se puede visitar la direccion http://localhost:8080 y aparecera una panta-

lla la en la cual se debe ingresar el usuario y la contrasena, la cual se encuentra haciendo

click en el boton “Evaluation Login” como lo muestra la Figura 11.1.

Para parar la plataforma Pentaho BI en una terminal se ejecuta el siguiente comando

“stop-pentaho.sh” que se encuentra en el mismo directorio de la siguiente manera en la

terminal:

1Tenga en cuenta el comando sudo pentaho -u garantiza que el comando sera ejecutado con lospermisos del usuario pentaho. Si se omite, el servidor se ejecutara con permisos de root y eso se quiereevitar como se dijo en el anterior apartado. automaticamente cuando se inicia el sistema operativo.

30

Page 31: Guia Penta Ho

Figura 11.1: Pantalla Inicial Plataforma Pentaho BI

# sudo −u pentaho ./ stop−pentaho . sh/ opt /pentaho/ b i s e rv e r−ce/ opt /pentaho/ b i s e rv e r−ceWARNING: Using java from pathDEBUG: PENTAHO JAVA HOME=DEBUG: PENTAHO JAVA=javaUsing CATALINA BASE: / opt /pentaho/ b i s e rv e r−ce /tomcatUsing CATALINA HOME: / opt /pentaho/ b i s e rv e r−ce /tomcatUsing CATALINA TMPDIR: / opt /pentaho/ b i s e rv e r−ce /tomcat/tempUsing JRE HOME: / usrUsing CLASSPATH: / opt /pentaho/ b i s e rv e r−ce /tomcat/ bin /

boots t rap . j a r

31

Page 32: Guia Penta Ho

12 Iniciar la Plataforma Pentaho BI Automaticamente

Para iniciar la plataforma Pentaho BI cuando se inicia el sistema, se realiza un script

llamado “pentaho-init.sh” con el siguiente contenido:

#!/ bin / sh# go to the pentaho homecd / opt /pentaho/ b i s e rv e r−ce

# se t up command fo r pentaho user , s e t java environmentcmd=”sudo −u pentaho JAVA HOME=/opt /jvm/ JAVA OPTS=−Djava . awt .

head l e s s=true ”case ”$1” in

s t a r t )# run the o r i g i n a l pentaho s t a r t s c r i p t$cmd . / s ta r t−pentaho . sh >> pentaho−demo . l og &

; ;stop )# run the o r i g i n a l pentaho s t a r t s c r i p t$cmd . / stop−pentaho . sh >> pentaho−demo . l og &

; ;r e s t a r t )

$0 stop$0 s t a r t

; ;∗)

echo ”Usage : $0 { s t a r t | stop | r e s t a r t }”exit 1

esacexit 0

Este script debe ser copiado en el directorio /etc/init.d, se lo copia de la siguiente

manera en la terminal:

# cp pentaho−i n i t . sh / e t c / i n i t . d

32

Page 33: Guia Penta Ho

Para comprobar su funcionamiento, se puede comprobar de la siguiente manera en la

terminal:

# cp / e t c / i n i t . d/# ./ pentaho−i n i t . shUsage : . / pentaho− i n i t . sh { s t a r t | stop | r e s t a r t }# ./ pentaho−i n i t . sh s top# ./ pentaho−i n i t . sh s t a r t

Para indicar que el script se ejecute durante el arranque del sistema, se ejecuta lo si-

guiente en la terminal:

# update−rc . d pentaho−i n i t . sh d e f a u l t s

Para eliminar un servicio previamente instalado se usa el parametro -f de la siguiente

manera en la terminal:

# update−rc . d −f pentaho−i n i t . sh remove

33

Page 34: Guia Penta Ho

13 Iniciar la consola de Administracion

Para iniciar la consola de Administracion en una terminal se ejecuta el siguiente co-

mando ’start-pac.sh’ que se encuentra en el directorio “/opt/pentaho/administration-

console” de la siguiente manera en la terminal:

# cd /opt /pentaho/ admin i s t ra t ion−conso l e# sudo −u pentaho ./ s t a r t−pac . sh09 :26 : 28 , 749 INFO [ Je t tySe rve r ] Console i s now s t a r t e d . I t can be

acce s s ed us ing http :// poldrosky−l aptop :8099 or http: / / 1 2 7 . 0 . 1 . 1 : 8 0 9 9

Ahora ya se puede visitar la direccion http://localhost:8099 Se le pedira un nombre

de usuario y contrasena que por defecto son “admin” y “password”. Si se ha iniciado y

conectado a la consola de administracion debiera ver la pantalla de bienvenida como lo

muestra la Figura 13.1.

Figura 13.1: Pantalla Inicial Consola de Administracion

34