Thursday, March 16, 2017

Hybris Vertical Cluster Configuration with Apache mod_jk configuration

Hybris is having its own cluster setup and hence instead of using the application server cluster configuration the hybris cluster configuration has to be used. For the demonstration purpose I have used two instances of hybris instances in the same machine and an Apache HTTP Server as a load balancer with the help of mod_jk

Hybris Cluster Setup

  • Make sure that both the instances of the hybris is having same code and using the same db. 
  • Configure both instances to point to the same stand alone solr server. For reference see the link Solr Clustering and Replication in Hybris
  • Since both instances are running on the same machine, to avoid the port conflict change the ports in the second instance via following link Changing default ports in hybris
  • In case of vertical clustering and unicast we need to specify separate ports and if we are using other methods then same configuration has to be used in all the nodes even in case of vertical clustering
  • Enter the following values in the local.properties file in both the hybris isntances 
        #clustering
         clustermode=true
         cluster.nodes.autodiscovery=true
         cluster.nodes.ping.interval=10000
         cluster.nodes.stale.timeout=30000

    • Unicast

                 #unicast
                 cluster.broadcast.methods=unicast
                 cluster.broadcast.method.unicast.serveraddress=localhost
                 cluster.broadcast.method.unicast.clusternodes=localhost:9997 ; localhost:19997
    • JGroups
           cluster.broadcast.methods=jgroups 
           cluster.broadcast.method.jgroups=de.hybris.platform.cluster.jgroups.JGroupsBroadcastMethod
           cluster.broadcast.method.jgroups.tcp.bind_addr=localhost
           cluster.broadcast.method.jgroups.tcp.bind_port=7800
           cluster.broadcast.method.jgroups.channel.name=hybris-broadcast
           cluster.broadcast.method.jgroups.configuration=jgroups-udp.xml

<Connector protocol="AJP/1.3" port="${tomcat.ajp.port}" proxyPort="${proxy.http.port}" redirectPort="${proxy.ssl.port}" useIPVHosts="${tomcat.ajp.useipv}" connectionTimeout="10000" keepAliveTimeout="10000" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="node1">

<Connector protocol="AJP/1.3" port="${tomcat.ajp.port}" proxyPort="${proxy.http.port}" redirectPort="${proxy.ssl.port}" useIPVHosts="${tomcat.ajp.useipv}" connectionTimeout="10000" keepAliveTimeout="10000" />
<Engine name="Catalina" defaultHost="localhost" jvmRoute="node2">
Apache HTTP Server Load Blancer Setup
Follow the linnk HTTP Server mod_jk configuration to load balance Tomcat instances in Hybris

No comments:

Post a Comment