Cluster mode and plf cluster

  • Published on
    01-Nov-2014

  • View
    873

  • Download
    0

Embed Size (px)

DESCRIPTION

 

Transcript

  • 1. Cluster Overview and PLF ClusterBasic notions, configuration, common errors and current status TRAN Trung Thanh, PLF/MQ March 2012
  • 2. Agenda (1) 1 Cluster Introduction - Cluster, Whats it? - Why cluster? 2 Basic configuration - Basic cluster infrastructure with load balancing - Two-node PLF cluster 3 Advanced configuration - Hot spare server - Asymmetric load 4 PLF cluster current status - Story - Bugs relating to configuration - Bugs in the implementation www.exoplatform.com - Copyright 2012 eXo Platform 2
  • 3. Agenda (2) Conclusion and Perspective Q&A www.exoplatform.com - Copyright 2012 eXo Platform 3
  • 4. Agenda1 Cluster Introduction - Cluster, Whats it? - Why cluster?2 Basic configuration - Basic cluster infrastructure with load balancing - Two-node PLF cluster3 Advanced configuration - Hot spare server - Asymmetric load4 PLF cluster current status - Story - Bugs relating to configuration - Bugs in the implementation www.exoplatform.com - Copyright 2012 eXo Platform 4
  • 5. Cluster, What is it? High scalable and high available virtual server Fully transparent to end user Basic Cluster Infrastructure www.exoplatform.com - Copyright 2012 eXo Platform 5
  • 6. Why cluster? (1) Challenges Increase dramatically the traffic of Internet ( annual rate > 100%) Increase rapidly workload of servers Enhance the availability of servers Solutions Upgrade the software/hardware of servers Multi-server Cluster Grid Cloud www.exoplatform.com - Copyright 2012 eXo Platform 6
  • 7. Why cluster? (2) Cluster Notions Scalability Load Balancing Load Balancing with an appliance Load Balancing with a software/hardware combination mod_proxy, mod_jk, mod_cluster High Availability www.exoplatform.com - Copyright 2012 eXo Platform 7
  • 8. Agenda1 Cluster Introduction - Cluster, Whats it? - Why cluster?2 Basic configuration - Basic cluster infrastructure with load balancing - Two-node PLF cluster3 Advanced configuration - Hot spare server - Asymmetric load4 PLF cluster current status - Story - Bugs relating to configuration - Bugs in the implementation www.exoplatform.com - Copyright 2012 eXo Platform 8
  • 9. Basic Cluster Infrastructure with load balancing www.exoplatform.com - Copyright 2012 eXo Platform 9
  • 10. Two-node PLF cluster Load Balancer: mod_jk Server cluster: 2 nodes ( 2 instances of PLF in same machine or in 2 distinguished machines) Shared Storage: NFS: indexing data, key for gadget DB server: shared PLF data www.exoplatform.com - Copyright 2012 eXo Platform 10
  • 11. Mod_jk(1) Connector used to connect the Tomcat Servlet Container with Web Servers Use AJP (Apache Jserv Protocol) Roles Load the servlet container adapter library and initialize it (prior to serving requests) Check and redirect requests to servlet to handle it www.exoplatform.com - Copyright 2012 eXo Platform 11
  • 12. Mod_jk(2) mod_jk configuration step-by-step Install apache Add mod_jk modules to apache Configure mod_jk parameters in apache configuration (httpd.conf) Assign URL to apache JkMount Configure worker properties: IP, port for AJP, hostname www.exoplatform.com - Copyright 2012 eXo Platform 12
  • 13. PLF cluster configuration(1) Notes Use profile all to deploy PLF server in cluster mode PLF user external connector to connect DB Need to add a external connector if necessary Configure datasource Config target $TOMCAT_HOME/conf/server.xml (tomcat server) $JBOSS_HOME/server/all/gatein-ds.xml (jboss server). Parameters User name/password, connector, database address www.exoplatform.com - Copyright 2012 eXo Platform 13
  • 14. PLF cluster configuration(2) Configure NFS Config target $TOMCAT_HOME/conf/server.xml (tomcat server) $JBOSS_HOME/server/all/deploy/jbossweb.sar/server.xml (jboss server) Configure AJP route Config target $TOMCAT_HOME/gatein/conf/configuration.properties (tomcat server) $JBOSS_HOME/server/all/conf/gatein/configuration.properties (jboss server) Parameters Add JVM Route to mark the name of server used by mod_jk www.exoplatform.com - Copyright 2012 eXo Platform 14
  • 15. PLF cluster configuration(3) Activate PLF configuration Tomcat Switch jcr mode to cluster Add profile cluster to eXo Profile Add preferIPv4Stack parameter to route message for synchronized Jboss Switch jcr mode to cluster Add profile cluster to eXo Profile Add preferIPv4Stack parameter to route message for synchronized Activate Cluster Single On www.exoplatform.com - Copyright 2012 eXo Platform 15
  • 16. PLF cluster configuration(4) Start PLF Tomcat ./start_eXo.sh Jboss bin/run.sh -g MyClusterPartition -b IP_NODE -c all www.exoplatform.com - Copyright 2012 eXo Platform 16
  • 17. PLF cluster configuration(5) Verify cluster In console, when a new member is added or any downs INFO [MyClusterPartition] Dead members: 0 ([]) INFO [MyClusterPartition] New Members : 1 ([127.0.0.1:1099]) INFO [MyClusterPartition] All Members : 2 ([127.0.0.1:1199, 127.0.0.1:1099]) www.exoplatform.com - Copyright 2012 eXo Platform 17
  • 18. PLF cluster configuration(6) Common errors in configuring and use cluster mode Error on connection to DB server Lack of connector in lib Add connector Wrong database address parameters Verify database parameters DB isnt set to accept remote access Configure to accept remote access Indexing data and database arent matched Remove indexing data and database if possible www.exoplatform.com - Copyright 2012 eXo Platform 18
  • 19. Agenda1 Cluster Introduction - Cluster, Whats it? - Why cluster?2 Basic configuration - Basic cluster infrastructure with load balancing - Two-node PLF cluster3 Advanced configuration - Hot spare server - Asymmetric load4 PLF cluster current status - Story - Bugs relating to configuration - Bugs in the implementation www.exoplatform.com - Copyright 2012 eXo Platform 19
  • 20. Advanced Configuration(1) Hot Spare server l Failover mechanism to provide reliability l A key component fails, the hot spare is switched into operation www.exoplatform.com - Copyright 2012 eXo Platform 20
  • 21. Advanced configuration(2) Hot spare configuration Set hot spare server for main server # Define preferred failover node for plfnode1 worker.plfnode1.redirect=plfnode2 Deactivate hot spare server # Disable plfnode2 for all requests except failover worker.plfnode2.activation=disabled www.exoplatform.com - Copyright 2012 eXo Platform 21
  • 22. Advanced Configuration(3)Asymmetric load l User to divide the workload among servers l Use lbfactor for each server worker.plfnode1.lbfactor=2 worker.plfnode2.lbfactor=8 www.exoplatform.com - Copyright 2012 eXo Platform 22
  • 23. Agenda1 Cluster Introduction - Cluster, What