preloder

Hybris cluster deployment: The one-stop guide

Hybris cluster deployment: The one-stop guide

Published on Dec 5, 2017

to my surprise something so powerful and in demand, was not documented properly for a begginner, had to jump through alot of hoops, so here is my effort to provide everything I know about clustering hybris. I have chosen to host this cluster on AWS. for now this article will assume you have basic knowledge of hybris and its architecture, later if I find time I will provide more details, which I will brush over right now. so prep the system by uploading Hybris version 6.5 on it, write down b2c extensions in localextensions.xml and in local.properties copy down the below settings.

1clustermode=true  
2cluster.id=0 #change for each node
3cluster.broadcast.method=jgroups
4cluster.broadcast.method.jgroups=de.hybris.platform.cluster.jgroups.JGroupsBroadcastMethod
5cluster.broadcast.method.jgroups.tcp.bind_addr=`aws.private.ip`
6cluster.broadcast.method.jgroups.tcp.bind_port=7800
7cluster.broadcast.method.jgroups.channel.name=hybris-broadcast
8cluster.broadcast.method.jgroups.configuration=jgroups-tcp.xml

next step is in platform folder, make a file

jgroups-tcp.xml

exec ant command start the server + init.

go in cluster page check if nodes are showing up. once a proper instance is configured make an ami of it and take the cluster.id and from environment cluster.broadcast.method.jgroups.tcp.bind_addr and http://169.254.169.254/meta-data (link) could be used for auto-scaling it requires two parameters which cluster.id and ip which can be automated.

for deploying cluster in udp unicast method; use below config in local.properties files;

1clustermode=true  
2cluster.nodes.autodiscovery=true #if enabled, you wont have to explicitly define cluster node id.
3cluster.broadcast.methods=unicast  
4cluster.broadcast.method.unicast.serveraddress=`aws.private.ip`
5cluster.broadcast.method.unicast.port=9997 #needs to be same in all clusters
6cluster.broadcast.method.unicast.clusternodes= this-node-private-ip:with-above port ; other-node-private-ip:with-same-port ;
7cluster.broadcast.method.unicast.sync.nodes.interval=1 #anything below, will not sync.

thats it. what I realized it if your cluster is going to handle a blackfriday load, you are better of with jgroups as its faster, but for normal node 3 nodes in unicast with load balancer would suffice. once could use multiple cluster with multiple groups each having there own work load like for example one cluster group handles storefront and 2nd cluster group handles backend activities like cornJobs and indexing, and third cluster group handles backoffice/admin. but it raises a question does not installing those extension on other cluster group create db problems for example if storefront extension is not available in cluster group 3 will it create problem in database models, I feel it should not until and unless some custom extension is deployed, will have to test thoroughly. and to better understand the difference between different clustering method, I plan on running detailed jmeter load test, will publish my results soon with test case.

log4j.logger.de.hybris.platform.cluster.PingBroadcastHandler=DEBUG

add above for debugging.

change the required settings of session as required if nodes in cluster require session replication or you could use few of your nodes for storefront and other nodes with no session replication for back office. I have seen this happen, for example one node is for consumers and others for back office/admin. so consumer one will have extensions related to him and not of back office, and vice versa for back office node. so when load hits just let auto-scaling handle the consumer end nodes.

My helpful picture

as I find time I will try to keep this post updated and differentiate in parts, and explain further.


Learn more about how we add value!

Start a Project

X

  • WORK WITH US

    Before we start, please fill this form to provide us some basic information.

  • This field is for validation purposes and should be left unchanged.
X

Oops! We could not locate your form.

  • Referrals for FAIR employees

    Please confirm your company email to submit your referral


X