SlideShare a Scribd company logo
1 of 32
Cluster-Enabling Sakai
               with Terracotta
                                                                                             Cris J. Holdorph
                                                                                                 Software Architect
                                                                                                       Unicon, Inc.

                                                                                                 Sakai Conference
                                                                                                   Cambridge, MA
                                                                                                     July 9, 2009




© Copyright Unicon, Inc., 2009. Some rights reserved. This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/us/
Agenda
1. Why Terracotta?
2. Current Status
3. Design and Development
4. Running Terracotta-Enabled Sakai
5. Terracotta-Cluster Enabling a Tool
6. Demo
7. Resources
                                        2
Why Terracotta?




                  3
Why Terracotta
●
    Clustering / Session Failover problem
●
    What options were explored?
    –   Container Managed Sessions
    –   Shared Session Server
         ●
             Ehcache
         ●
             Database
    –   REST style (no session data) web architecture
●
    What problems were uncovered?
    –   Custom Classloaders
    –   Performance
                                                        4
    –   Serializable Objects
Enter Terracotta
●
    Semi-shared Session Server
    –   Don't share everything
●
    Reduced Communication Between Nodes
    –   “Partitioned Data” feature of Terracotta
●
    Less Invasive Sakai Changes
    –   Not every object in Terracotta has to be
        Serializable
    –   Many changes can be done in a Terracotta
        configuration file (tc-config.xml)
●
    Provides a Custom Classloader Solution
                                                   5
Current Status




                 6
Current Status
●
    John Wiley & Sons sponsored Unicon to
    develop Terracotta integration with Sakai
●
    Documentation is in Sakai Confluence
●
    Original Work done as a feature branch
    against Sakai 2.5.x, ported forward to 2.6.x
●
    Migrated into Sakai Trunk / Kernel Trunk
    –   This will be Sakai 2.7.x / Kernel 1.1.x if released
●
    Feature branch (only) contains 2 cluster
    enabled tools
    –   Custom Worksite Setup
                                                              7
    –   Resources / Citations
Design and Development




                         8
Component Manager
●
    Create Custom Classloader
●
    Detecting “sakai.cluster.terracotta” System
    Property
●
    Using Custom Classloader if property is set




                                                  9
Code sample
https://source.sakaiproject.org/svn/kernel/trunk/component-manager/src/
main/java/org/sakaiproject/util/TerracottaClassLoader.java


  ...
  class TerracottaClassLoader extends URLClassLoader {
        private String classLoaderName;
        public TerracottaClassLoader(URL[] urls, ClassLoader
  parent, String classLoaderName) { ... }
      public String __tc_getClassLoaderName() {
            return classLoaderName;
      }
  ...
  }

                                                                  10
SessionManager
●
    Make m_sessions a Terracotta Root
●
    Make MySession and MyLittleSession top level
    classes
    –   Did not want Outer class, SessionManager,
        brought into the Terracotta cluster




                                                    11
Partial Session Sharing
●
    Not all data will be shared
●
    Original Idea, catch NonPortableException
    –   Did not work
●
    New Idea, Tool whitelist
    –   Only tools in the whitelist will be shared
    –   Tools not in the whitelist will not be shared
●
    Final solution, enables gradually enabling
    clustering on a tool-by-tool basis
●
    Even if a tool supports clustering, a system
    administrator can turn clustering off for that
    tool                                         12
Session Maintenance
●
    SessionManager class has an inner
    class/thread called Maintenance
    –   Responsible for removing expired sessions
●
    Need to make sure this behavior still works
●
    Need to make sure this thread/class does not
    violate the Terracotta “Partitioned Data”
    principle
●
    Solution: Create a parallel data structure to
    loosely track session timeout times along with
    session identifiers
                                                    13
UsageSession
●
    UsageSession tracks which user is on which
    server
●
    UsageSession is both a JVM object and
    database record
●
    Need to detect when a user has failed over to
    a new server and update the users
    UsageSession object and database record




                                              14
RequestFilter
●
    Terracotta requires a lock (transaction) be
    obtained to change any data in the cluster
●
    Original design tried to automatically lock any
    clustered object before changing data on that
    object
●
    New design uses a Course Grained lock on
    the Session object, obtained and released in
    the Sakai RequstFilter



                                                  15
Unit Tests
●
    Unit Tests for Component Manager before
    Component Manager changes were made
●
    Unit Tests for Session Manager before Session
    Manager changes were made




                                              16
Session Logging
●
    Code was added to Session Manager to
    enable logging of which tools put which
    objects into a Sakai Session
●
    This helps identify
    –   Heavy users of the Session
    –   Relative size of a Session
    –   Which tools are more self referencing
    –   Which tools tend to reference many other
        tools/components


                                                   17
Worksite Setup
●
    Customized Worksite Setup Tool for John
    Wiley & Sons
●
    Multi-page wizard
●
    Old Sakai / Velocity based tool
●
    Lots of inner classes
●
    Feature branch – Terracotta cluster enabled




                                                  18
Resources / Citations
●
    Provide a vanilla Sakai tool to demonstrate
    Terracotta clusterability
●
    Citation List creation can be a multi-page
    wizard style interaction
●
    Feature branch – Terracotta cluster enabled




                                                  19
Running a Terracotta-
   Enabled Sakai




                        20
Building
●
    Must compile and build the terracotta-config
    module
●
    Must run maven with a special flag
mvn -Dterracotta.enable=true clean install




                                               21
Running
●
    Starting Terracotta Server
    –   tc-config.xml file
    –   Creating the TIM repository
●
    JAVA_OPTS for Sakai / Tomcat
    –   -Dsakai.cluster.terracotta=true -Dtc.install-root=$
        {TC_HOME} -Xbootclasspath/p:${TC_HOME}/lib/
        dso-boot/dso-boot-hotspot_linux_150_14.jar
        -Dtc.config=127.0.0.1:9510
    –   tc-config.xml file



                                                        22
Administration
●
    Terracotta Administration Console
●
    Shutting down Sakai / Tomcat
●
    Shutting down Terracotta Server
●
    Clearing out the Terracotta Object
    “repository”




                                         23
Terracotta-Cluster Enabling a
          Sakai Tool




                            24
Terracotta Enabling a Tool
●
    Add the tool to the clusterableTools property
●
    Create a new TIM (Terracotta Integration
    Module) for the tool
●
    Modify the terracotta-config module to know
    about the new TIM that was created




                                                25
Creating a TIM
●
    Classes for instrumentation
    –   Any class that will be stored in Terracotta
    –   Any class that will modify a class stored in
        Terracotta
●
    Determine transient fields for any classes that
    will be stored in Terracotta
●
    Create a mechanism for resolving transient
    fields
    –   Beanshell
    –   Java method
●
    Promote inner classes to top level classes         26
Code sample
https://source.sakaiproject.org/svn/msub/unicon.net/content/branches/ses
sion-clustering-2-5-x/content-tim/src/main/resources/terracotta.xml


  <?xml version="1.0" encoding="UTF-8" ?>
  <xml-fragment>
         <instrumented-classes>
          <include>
                <class-
  expression>org.sakaiproject.content.types.FolderType$*</c
  lass-expression>
             <honor-transient>true</honor-transient>
          </include>
          <include>
  ...
                                                                   27
Gotchas
●
    Direct field access
    –   Prefer setters
●
    Inner classes
    –   If the outer class is not going to be stored in
        Terracotta, the inner class must be static, however
        this does not prevent the outer class from direct
        field access (see above)
●
    Additional Java classes
●
    Reference classes from another component /
    service

                                                        28
Resources




            29
Resources (1)
●
    Introduction to Terracotta
     –   Monday, 11:30 am
●
    Websites
     –   Open Source http://www.terracotta.org/
     –   Commercial http://www.terracottatech.com/
●
    Website Resources
     –   Downloads
     –   Documentation
     –   Forums
●
    Book
     –   The Definitive Guide to Terracotta, ISBN-13: 978-
         1590599860
                                                             30
Resources (2)
●
    Sakai Confluence Terracotta link
http://confluence.sakaiproject.org/confluence/display/TERRA/Home



●
    Feature Branch subversion link
https://source.sakaiproject.org/svn/msub/unicon.net/distros/branches/session-clustering-2-5-x/




                                                                                       31
Questions & Answers




          Cris J. Holdorph
          Software Architect
          Unicon, Inc.

          holdorph@unicon.net
          www.unicon.net



                                32

More Related Content

Similar to Clustering Sakai with Terracotta

Introduction to Terracotta
Introduction to TerracottaIntroduction to Terracotta
Introduction to TerracottaCris Holdorph
 
Clustering In The Wild
Clustering In The WildClustering In The Wild
Clustering In The WildSergio Bossa
 
Gestión de infraestructura tomcat tom ee con tfactory
Gestión de infraestructura tomcat tom ee con tfactoryGestión de infraestructura tomcat tom ee con tfactory
Gestión de infraestructura tomcat tom ee con tfactoryCésar Hernández
 
Writing Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason LeeWriting Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason Leejaxconf
 
Self-service PR-based Terraform
Self-service PR-based TerraformSelf-service PR-based Terraform
Self-service PR-based TerraformAndrew Kirkpatrick
 
Gestión de infraestructura tomcat/Tom EE con tfactory
Gestión de infraestructura tomcat/Tom EE con tfactoryGestión de infraestructura tomcat/Tom EE con tfactory
Gestión de infraestructura tomcat/Tom EE con tfactoryGuatemala User Group
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK toolsHaribabu Nandyal Padmanaban
 
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdf
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdfHashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdf
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdfssuser705051
 
Oracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityOracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityPaulo Fagundes
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introductionkanedafromparis
 
Building High Scalability Apps With Terracotta
Building High Scalability Apps With TerracottaBuilding High Scalability Apps With Terracotta
Building High Scalability Apps With TerracottaDavid Reines
 
OCDET Activity and Glusterfs
OCDET Activity and GlusterfsOCDET Activity and Glusterfs
OCDET Activity and GlusterfsMasanori Itoh
 
Collaborative Terraform with Atlantis
Collaborative Terraform with AtlantisCollaborative Terraform with Atlantis
Collaborative Terraform with AtlantisFerenc Kovács
 
OpenStack London Meetup, 18 Nov 2015
OpenStack London Meetup, 18 Nov 2015OpenStack London Meetup, 18 Nov 2015
OpenStack London Meetup, 18 Nov 2015Jesse Pretorius
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksRuslan Meshenberg
 
Benchmarking Solr Performance
Benchmarking Solr PerformanceBenchmarking Solr Performance
Benchmarking Solr PerformanceLucidworks
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...All Things Open
 

Similar to Clustering Sakai with Terracotta (20)

Introduction to Terracotta
Introduction to TerracottaIntroduction to Terracotta
Introduction to Terracotta
 
Clustering In The Wild
Clustering In The WildClustering In The Wild
Clustering In The Wild
 
Gestión de infraestructura tomcat tom ee con tfactory
Gestión de infraestructura tomcat tom ee con tfactoryGestión de infraestructura tomcat tom ee con tfactory
Gestión de infraestructura tomcat tom ee con tfactory
 
Writing Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason LeeWriting Plugged-in Java EE Apps: Jason Lee
Writing Plugged-in Java EE Apps: Jason Lee
 
Self-service PR-based Terraform
Self-service PR-based TerraformSelf-service PR-based Terraform
Self-service PR-based Terraform
 
Gestión de infraestructura tomcat/Tom EE con tfactory
Gestión de infraestructura tomcat/Tom EE con tfactoryGestión de infraestructura tomcat/Tom EE con tfactory
Gestión de infraestructura tomcat/Tom EE con tfactory
 
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
Performance Tuning -  Memory leaks, Thread deadlocks, JDK toolsPerformance Tuning -  Memory leaks, Thread deadlocks, JDK tools
Performance Tuning - Memory leaks, Thread deadlocks, JDK tools
 
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdf
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdfHashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdf
Hashicorp-Terraform-Deep-Dive-with-no-Fear-Victor-Turbinsky-Texuna.pdf
 
Terraform-2.pdf
Terraform-2.pdfTerraform-2.pdf
Terraform-2.pdf
 
Oracle exalytics deployment for high availability
Oracle exalytics deployment for high availabilityOracle exalytics deployment for high availability
Oracle exalytics deployment for high availability
 
Java Cloud and Container Ready
Java Cloud and Container ReadyJava Cloud and Container Ready
Java Cloud and Container Ready
 
Ippevent : openshift Introduction
Ippevent : openshift IntroductionIppevent : openshift Introduction
Ippevent : openshift Introduction
 
Building High Scalability Apps With Terracotta
Building High Scalability Apps With TerracottaBuilding High Scalability Apps With Terracotta
Building High Scalability Apps With Terracotta
 
OCDET Activity and Glusterfs
OCDET Activity and GlusterfsOCDET Activity and Glusterfs
OCDET Activity and Glusterfs
 
Collaborative Terraform with Atlantis
Collaborative Terraform with AtlantisCollaborative Terraform with Atlantis
Collaborative Terraform with Atlantis
 
OpenStack London Meetup, 18 Nov 2015
OpenStack London Meetup, 18 Nov 2015OpenStack London Meetup, 18 Nov 2015
OpenStack London Meetup, 18 Nov 2015
 
Apache cassandra v4.0
Apache cassandra v4.0Apache cassandra v4.0
Apache cassandra v4.0
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talks
 
Benchmarking Solr Performance
Benchmarking Solr PerformanceBenchmarking Solr Performance
Benchmarking Solr Performance
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...
 

More from Cris Holdorph

Programming for Performance
Programming for PerformanceProgramming for Performance
Programming for PerformanceCris Holdorph
 
Introduction to International MyLabs
Introduction to International MyLabsIntroduction to International MyLabs
Introduction to International MyLabsCris Holdorph
 
Using Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not EvilUsing Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not EvilCris Holdorph
 
Clustering Made Easier: Using Terracotta with Hibernate and/or EHCache
Clustering Made Easier: Using Terracotta with Hibernate and/or EHCacheClustering Made Easier: Using Terracotta with Hibernate and/or EHCache
Clustering Made Easier: Using Terracotta with Hibernate and/or EHCacheCris Holdorph
 
Developing JSR 286 Portlets
Developing JSR 286 PortletsDeveloping JSR 286 Portlets
Developing JSR 286 PortletsCris Holdorph
 
Adding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development ProjectAdding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development ProjectCris Holdorph
 

More from Cris Holdorph (7)

Programming for Performance
Programming for PerformanceProgramming for Performance
Programming for Performance
 
Introduction to International MyLabs
Introduction to International MyLabsIntroduction to International MyLabs
Introduction to International MyLabs
 
Using Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not EvilUsing Sakai Site Archive for Good not Evil
Using Sakai Site Archive for Good not Evil
 
No SQL Technologies
No SQL TechnologiesNo SQL Technologies
No SQL Technologies
 
Clustering Made Easier: Using Terracotta with Hibernate and/or EHCache
Clustering Made Easier: Using Terracotta with Hibernate and/or EHCacheClustering Made Easier: Using Terracotta with Hibernate and/or EHCache
Clustering Made Easier: Using Terracotta with Hibernate and/or EHCache
 
Developing JSR 286 Portlets
Developing JSR 286 PortletsDeveloping JSR 286 Portlets
Developing JSR 286 Portlets
 
Adding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development ProjectAdding Performance Testing to a Software Development Project
Adding Performance Testing to a Software Development Project
 

Recently uploaded

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 

Recently uploaded (20)

Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 

Clustering Sakai with Terracotta

  • 1. Cluster-Enabling Sakai with Terracotta Cris J. Holdorph Software Architect Unicon, Inc. Sakai Conference Cambridge, MA July 9, 2009 © Copyright Unicon, Inc., 2009. Some rights reserved. This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/us/
  • 2. Agenda 1. Why Terracotta? 2. Current Status 3. Design and Development 4. Running Terracotta-Enabled Sakai 5. Terracotta-Cluster Enabling a Tool 6. Demo 7. Resources 2
  • 4. Why Terracotta ● Clustering / Session Failover problem ● What options were explored? – Container Managed Sessions – Shared Session Server ● Ehcache ● Database – REST style (no session data) web architecture ● What problems were uncovered? – Custom Classloaders – Performance 4 – Serializable Objects
  • 5. Enter Terracotta ● Semi-shared Session Server – Don't share everything ● Reduced Communication Between Nodes – “Partitioned Data” feature of Terracotta ● Less Invasive Sakai Changes – Not every object in Terracotta has to be Serializable – Many changes can be done in a Terracotta configuration file (tc-config.xml) ● Provides a Custom Classloader Solution 5
  • 7. Current Status ● John Wiley & Sons sponsored Unicon to develop Terracotta integration with Sakai ● Documentation is in Sakai Confluence ● Original Work done as a feature branch against Sakai 2.5.x, ported forward to 2.6.x ● Migrated into Sakai Trunk / Kernel Trunk – This will be Sakai 2.7.x / Kernel 1.1.x if released ● Feature branch (only) contains 2 cluster enabled tools – Custom Worksite Setup 7 – Resources / Citations
  • 9. Component Manager ● Create Custom Classloader ● Detecting “sakai.cluster.terracotta” System Property ● Using Custom Classloader if property is set 9
  • 10. Code sample https://source.sakaiproject.org/svn/kernel/trunk/component-manager/src/ main/java/org/sakaiproject/util/TerracottaClassLoader.java ... class TerracottaClassLoader extends URLClassLoader { private String classLoaderName; public TerracottaClassLoader(URL[] urls, ClassLoader parent, String classLoaderName) { ... } public String __tc_getClassLoaderName() { return classLoaderName; } ... } 10
  • 11. SessionManager ● Make m_sessions a Terracotta Root ● Make MySession and MyLittleSession top level classes – Did not want Outer class, SessionManager, brought into the Terracotta cluster 11
  • 12. Partial Session Sharing ● Not all data will be shared ● Original Idea, catch NonPortableException – Did not work ● New Idea, Tool whitelist – Only tools in the whitelist will be shared – Tools not in the whitelist will not be shared ● Final solution, enables gradually enabling clustering on a tool-by-tool basis ● Even if a tool supports clustering, a system administrator can turn clustering off for that tool 12
  • 13. Session Maintenance ● SessionManager class has an inner class/thread called Maintenance – Responsible for removing expired sessions ● Need to make sure this behavior still works ● Need to make sure this thread/class does not violate the Terracotta “Partitioned Data” principle ● Solution: Create a parallel data structure to loosely track session timeout times along with session identifiers 13
  • 14. UsageSession ● UsageSession tracks which user is on which server ● UsageSession is both a JVM object and database record ● Need to detect when a user has failed over to a new server and update the users UsageSession object and database record 14
  • 15. RequestFilter ● Terracotta requires a lock (transaction) be obtained to change any data in the cluster ● Original design tried to automatically lock any clustered object before changing data on that object ● New design uses a Course Grained lock on the Session object, obtained and released in the Sakai RequstFilter 15
  • 16. Unit Tests ● Unit Tests for Component Manager before Component Manager changes were made ● Unit Tests for Session Manager before Session Manager changes were made 16
  • 17. Session Logging ● Code was added to Session Manager to enable logging of which tools put which objects into a Sakai Session ● This helps identify – Heavy users of the Session – Relative size of a Session – Which tools are more self referencing – Which tools tend to reference many other tools/components 17
  • 18. Worksite Setup ● Customized Worksite Setup Tool for John Wiley & Sons ● Multi-page wizard ● Old Sakai / Velocity based tool ● Lots of inner classes ● Feature branch – Terracotta cluster enabled 18
  • 19. Resources / Citations ● Provide a vanilla Sakai tool to demonstrate Terracotta clusterability ● Citation List creation can be a multi-page wizard style interaction ● Feature branch – Terracotta cluster enabled 19
  • 20. Running a Terracotta- Enabled Sakai 20
  • 21. Building ● Must compile and build the terracotta-config module ● Must run maven with a special flag mvn -Dterracotta.enable=true clean install 21
  • 22. Running ● Starting Terracotta Server – tc-config.xml file – Creating the TIM repository ● JAVA_OPTS for Sakai / Tomcat – -Dsakai.cluster.terracotta=true -Dtc.install-root=$ {TC_HOME} -Xbootclasspath/p:${TC_HOME}/lib/ dso-boot/dso-boot-hotspot_linux_150_14.jar -Dtc.config=127.0.0.1:9510 – tc-config.xml file 22
  • 23. Administration ● Terracotta Administration Console ● Shutting down Sakai / Tomcat ● Shutting down Terracotta Server ● Clearing out the Terracotta Object “repository” 23
  • 25. Terracotta Enabling a Tool ● Add the tool to the clusterableTools property ● Create a new TIM (Terracotta Integration Module) for the tool ● Modify the terracotta-config module to know about the new TIM that was created 25
  • 26. Creating a TIM ● Classes for instrumentation – Any class that will be stored in Terracotta – Any class that will modify a class stored in Terracotta ● Determine transient fields for any classes that will be stored in Terracotta ● Create a mechanism for resolving transient fields – Beanshell – Java method ● Promote inner classes to top level classes 26
  • 27. Code sample https://source.sakaiproject.org/svn/msub/unicon.net/content/branches/ses sion-clustering-2-5-x/content-tim/src/main/resources/terracotta.xml <?xml version="1.0" encoding="UTF-8" ?> <xml-fragment> <instrumented-classes> <include> <class- expression>org.sakaiproject.content.types.FolderType$*</c lass-expression> <honor-transient>true</honor-transient> </include> <include> ... 27
  • 28. Gotchas ● Direct field access – Prefer setters ● Inner classes – If the outer class is not going to be stored in Terracotta, the inner class must be static, however this does not prevent the outer class from direct field access (see above) ● Additional Java classes ● Reference classes from another component / service 28
  • 29. Resources 29
  • 30. Resources (1) ● Introduction to Terracotta – Monday, 11:30 am ● Websites – Open Source http://www.terracotta.org/ – Commercial http://www.terracottatech.com/ ● Website Resources – Downloads – Documentation – Forums ● Book – The Definitive Guide to Terracotta, ISBN-13: 978- 1590599860 30
  • 31. Resources (2) ● Sakai Confluence Terracotta link http://confluence.sakaiproject.org/confluence/display/TERRA/Home ● Feature Branch subversion link https://source.sakaiproject.org/svn/msub/unicon.net/distros/branches/session-clustering-2-5-x/ 31
  • 32. Questions & Answers Cris J. Holdorph Software Architect Unicon, Inc. holdorph@unicon.net www.unicon.net 32