Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Synchronous Session Replication for Pentaho BI Server in Tomcat Clustering

  1. #1
    Join Date
    Sep 2011
    Posts
    1

    Default Synchronous Session Replication for Pentaho BI Server in Tomcat Clustering

    I have written a patch for the 3.8.0-stable branch of the Pentaho BI server which enables synchronous session replication with Tomcat on N physical servers in an HA environment. We're running this on CentOS 5.7 with LVS managing the VIP and Apache Tomcat 7.0.20.

    This marks my first foray into java so please be kind if you see any major gotchas. So far the changes appear to be working swimmingly. Along with patching the source code, I set these configuration options:

    * Enabled NTP to ensure clocks are synced between cluster nodes
    * Enabled quartz cluster settings:

    # our host names are 'service-##' which translates well to instance ids
    INSTANCE_ID=`hostname | awk 'BEGIN { FS="-"; }; { print $2 }'\; | /usr/bin/bc`
    sed -i "s/org\.quartz\.scheduler\.instanceId = 1/org\.quartz\.scheduler\.instanceId = ${INSTANCE_ID}/g" quartz.properties
    sed -i 's/org\.quartz\.jobStore\.isClustered = false/org\.quartz\.jobStore\.isClustered = true/g' quartz.properties

    * Enabled tomcat clustering:

    ################################################################################################################
    CLUSTER_MCAST="228.0.0.4"
    CLUSTER_FREQ="500"
    CLUSTER_DROP="3000"
    CLUSTER_PORT="45540"
    cd /usr/local/apache-tomcat/conf
    cp server.xml server.xml.ORIG
    cat <<_EOF > cluster-config.pl
    #!/usr/bin/perl -w
    use IO::All;
    use strict;
    my \$data < io(\$ARGV[0]);
    my \$re = qr/(([ ]*<!--.*\n){1})(.*<Cluster.*\n)((.*?\n){1})/m;
    # use \n$3 to simply uncomment and enable the cluster with defaults
    \$data =~ s/\$re//s;
    io(\$ARGV[0]) < \$data;
    _EOF
    chmod +x cluster-config.pl
    ./cluster-config.pl server.xml
    cat <<_EOF > pentaho-cluster.xml
    <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
    channelSendOptions="8">

    <Manager className="org.apache.catalina.ha.session.DeltaManager"
    expireSessionsOnShutdown="false"
    notifyListenersOnReplication="true"
    sendAllSessions="true"/>

    <Channel className="org.apache.catalina.tribes.group.GroupChannel">
    <Membership className="org.apache.catalina.tribes.membership.McastService"
    address="${CLUSTER_MCAST}"
    port="${CLUSTER_PORT}"
    frequency="${CLUSTER_FREQ}"
    dropTime="${CLUSTER_DROP}"/>
    <Receiver className="org.apache.catalina.tribes.transport.nio.NioReceiver"
    address="${IP}"
    port="4000"
    autoBind="100"
    selectorTimeout="5000"
    maxThreads="6"/>

    <Sender className="org.apache.catalina.tribes.transport.ReplicationTransmitter" replicationMode="synchronous">
    <Transport className="org.apache.catalina.tribes.transport.nio.PooledParallelSender"/>
    </Sender>
    <Interceptor className="org.apache.catalina.tribes.group.interceptors.TcpFailureDetector"/>
    <Interceptor className="org.apache.catalina.tribes.group.interceptors.MessageDispatch15Interceptor"/>
    </Channel>

    <Valve className="org.apache.catalina.ha.tcp.ReplicationValve"
    filter=""/>
    <Valve className="org.apache.catalina.ha.session.JvmRouteBinderValve"/>

    <Deployer className="org.apache.catalina.ha.deploy.FarmWarDeployer"
    tempDir="/tmp/war-temp/"
    deployDir="/tmp/war-deploy/"
    watchDir="/tmp/war-listen/"
    watchEnabled="false"/>

    <ClusterListener className="org.apache.catalina.ha.session.JvmRouteSessionIDBinderListener"/>
    <ClusterListener className="org.apache.catalina.ha.session.ClusterSessionListener"/>
    </Cluster>
    _EOF
    csplit -f server-xml-part server.xml '/<\!-- Use the LockOutRealm to prevent attempts/' >/dev/null 2>&1
    cat server-xml-part00 pentaho-cluster.xml server-xml-part01 > server.xml
    rm -f cluster-config.pl pentaho-cluster.xml server-xml-part0*
    ################################################################################################################


    ... and that's pretty much it. I hope this can help someone out, it was a fun weekend project to delve into the java source code.


    William Strucke
    2Checkout.com, Inc.
    614-921-2450x135
    www.2checkout.com

    bi-platform-3.8.0-stable-synchronous-sessions.zip

  2. #2
    Join Date
    Jan 2007
    Posts
    25

    Default

    I am trying this patch, and works fine, but i have jpivot - wcf serialization problems...... so how you deal with jpivot serialization? dont use jpivot?
    thanks for any help...

  3. #3
    Join Date
    Jun 2013
    Posts
    6

    Default

    Does this work in BA 5.0.2 with Tomcat 6?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.