Sign inSign up

fivecorp/pentaho-env

By fivecorp

•Updated about 5 years ago

Pentaho environment

Image
3

3.1K

fivecorp/pentaho-env repository overview

⁠Pentaho-BI container

Pentaho BI Community Edition container, with helper script to configure the Pentaho environment to use postgresql as the repository.

To build the container:

git clone https://bitbucket.org/five_corp/docker-pentaho-env.git
cd docker-pentaho-env

# To build the x86 version
docker build --rm -t pentaho-env .

To run:

docker run --rm -p 8080:8080 \
           -v /opt/pentaho/pentaho-server:/opt/pentaho-server \
           --name pentaho pentaho-env

The container exposes port 8080.

⁠Volumes

Pentaho runs from directory /opt/pentaho-server. You must:

  • Download the Pentaho Business Analytics Platform - Community Edition software from http://community.pentaho.com⁠
  • Unzip it somewhere in your host server, say /opt/pentaho
  • Mount the resulting /opt/pentaho/pentaho-server folder to the container, in the /opt/pentaho-server path.

⁠Configuration

The container includes a helper script to help configure the Pentaho installation to connect to the PostgreSQL repository. Run the command /opt/config.sh inside the container, providing the following parameters:

  • PostgreSQL server name
  • PostgreSQL server port
  • Prefix to add to the databases, to make the names unique
  • Password for the quartz and jackrabbit users
  • Cluster ID (must be different for each container in the cluster)

e.g, run:

docker run --rm -it \
  -v /opt/pentaho/pentaho-server:/opt/pentaho-server \
  pentaho-env \
  /opt/config.sh postgresql.server.com 5432 prefix_ MySecret1234 node1 > script.sql

OPTIONAL: if you have different passwords for jackrabbit, hibernate and/or quartz users, you can specify them separately as environment variables:

  • JACKRABBIT_PASSWORD
  • QUARTZ_PASSWORD
  • HIBERNATE_PASSWORD

e.g, run:

docker run --rm -it \
  -v /opt/pentaho/pentaho-server:/opt/pentaho-server \
  -e JACKRABBIT_PASSWORD=<password-for-jackrabbit> \
  pentaho-env  \
  /opt/config.sh <postgres_server> <postgres_port> <postgres_prefix> <other_password> <nodeid> > script.sql

The output of this command is the set of SQL statements to run in the database, in order to create the required schemas, users and passwords, e.g.:

psql -U root -h postgresql.server.com < script.sql

If you have created the users and databases beforehnd, you can skip the user & db creation statements by providing the flag -n (or --no-create-db) as first argument for the config function, e.g:

docker run --rm -it \
  -v /opt/pentaho/pentaho-server:/opt/pentaho-server \
  -e JACKRABBIT_PASSWORD=<password-for-jackrabbit> \
  pentaho-env  \
  /opt/config.sh --no-create-db <postgres_server> <postgres_port> <postgres_prefix> <other_password> <nodeid> > script.sql

The schema can also be auto-deployed at first boot, if you provide the postgres user password in the POSTGRESS_PASSWORD environment variable. Be aware that this will leave your postgres user password available for any user logged into the server.

⁠Hooks

Once pentaho configuration is done, the config script will run any script file in /opt/hooks. So if you need to do some customization at config time (e.g. add a .jar to the pentaho lib folder, update any config file, etc), you can do it as a config hook. Just drop a .sh file in the /opt/hooks folder.

⁠Environment variables

If Pentaho is to be run behind a reverse proxy, the following environment variables must be provided:

  • PENTAHO_PORT: port number where pentaho is listening, default 8080
  • PROXY_PORT: port number of the proxy, default 80.
  • PROXY_SCHEME: scheme used by the proxy, default http.

Typically, if deploying behind a ssl proxy, the values of these environment variables should be:

  • PROXY_PORT=443
  • PROXY_SCHEME=https

Additionaly, the container supports extra startup parameters in the EXTRA_CATALINA_OPTS environment variable, e.g.

  • EXTRA_CATALINA_OPTS="-Duser.timezone=Europe/Madrid"

⁠HTTPS Fixes

If you run Pentaho behind a reverse HTTPS proxy, it will not be able to get the right schema from the URL, and some .jsp files will incorrectly render links to external resources using http:// instead of https://. This yields errors in some browsers.

To fix this, you may need to edit the .jsp files where those links are generated, and set the schema to https by hand. The affected files are:

  • tomcat/webapps/pentaho/mantle/home/index.jsp: look for BrightcoveExperiences.js

⁠Optimization

The default Pentaho config misses a few opportunities for optimizations:

  • Enable server mode for the JVM by adding the flag -server to the JVM commandline at tomcat/bin/startup.sh
  • Set the heap initial and maximum size at the same file.
  • Disable Audit Logging by replacing the IAuditEntry bean at ./pentaho-solutions/system/pentahoObjects.spring.xml with the following bean:
<bean id="IAuditEntry" class="org.pentaho.platform.engine.core.audit.NullAuditEntry" scope="singleton" />
  • Since this is a docker container, logs are better sent to the console instead of a file. To change the logging settings,

    • Remove the references to the PENTAHOFILE appender at tomcat/webapps/pentaho/WEB-INF/classes/log4j.xml
    • Change the logging levels at pentaho-solutions/system/cda/log4j.xml
    • Leave only one handler at the .handlers stanza of tomcat/logging.properties:
.handlers = java.util.logging.ConsoleHandler

  • Improve the configuration of the tomcat Connector at tomcat/conf/server.xml:

    • Uncomment the tomcatThreadPool Executor tag and add the executor="tomcatThreadPool" attribute to the Connector tag. 200 threads per CPU is the suggested configuration for the Executor.

    • If your installation must support keepalives, replace the blocking BIO scheduler by the native APR one, adding the attribute protocol="org.apache.coyote.http11.Http11AprProtocol" to the Connector tag.

      • Notice that if there are no keepalives, even in the face of high concurrency, the BIO scheduler (protocol="HTTP/1.1") is preferred.
      • If that's the case, disable keepalives altogether with the maxKeepAliveRequests=1 attribute.
    • Disable DNS lookups by adding the attribute enableLookups=false" to the Connector tag.

Tag summary

Content type

Image

Digest

Size

258.6 MB

Last updated

over 6 years ago

docker pull fivecorp/pentaho-env