Message Boards

Liferay 6.2 CE Clustering in AWS - Cache not syncing everywhere.

Navaneethakrishnan Natarajan, modified 2 Years ago.

Liferay 6.2 CE Clustering in AWS - Cache not syncing everywhere.

New Member Posts: 2 Join Date: 6/9/20 Recent Posts

Environment: Liferay 6.2 CE GA6 with tomcat bundle, Hosted on AWS EC2 instances, using AWS RDS MySQL, Load balanced through AWS ELB.

Hi,
We are trying to configure Liferay cluster in AWS EC2 server, with Liferay ELB as the loadbalancer and RDS MySQL as the database.

Below is our portal-ext.properties configuration,  
--------------------------------------------------------------------------------------------------------------------------------------
portal.instance.http.port=8080
portal.instance.protocol=http

cluster.link.enabled=true
cluster.link.autodetect.address=liferayportal_db:3306
cluster.link.channel.properties.control=/liferay-server/node-02/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/jgroups/tcp.xml
cluster.link.channel.properties.transport.0=/liferay-server/node-02/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/jgroups/tcp.xml
ehcache.bootstrap.cache.loader.factory=com.liferay.portal.cache.ehcache.JGroupsBootstrapCacheLoaderFactory
ehcache.cache.event.listener.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory
#ehcache.cache.manager.peer.provider.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory
ehcache.cache.manager.peer.provider.factory=com.liferay.portal.cache.ehcache.JGroupsCacheManagerPeerProviderFactory
transactional.cache.enable=true
ehcache.cluster.link.replication.enabled=true

ehcache.multi.vm.config.location.peerProviderProperties=clusterName=hibernate,channelProperties=/jgroups/tcp.xml
ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered.xml
net.sf.ehcache.configurationResourceName.peerProviderProperties=clusterName=hibernate,channelProperties=/jgroups/tcp.xml
net.sf.ehcache.configurationResourceName=/ehcache/hibernate-clustered.xml#ehcache.portal.cache.manager.jmx.enabled=true
cluster.executor.debug.enabled=true
web.server.display.node=true
---------------------------------------------------------------------------------------------------------------------------

tcp.xml file contents,

-------------------------------------------------------------------------------------------------------
<TCP singleton_name="jgroups"
         bind_port="7800"
         loopback="false"
         recv_buf_size="${tcp.recv_buf_size:5M}"
         send_buf_size="${tcp.send_buf_size:640K}"
         max_bundle_size="64K"
         max_bundle_timeout="30"
         enable_bundling="true"
         use_send_queues="true"
         sock_conn_timeout="300"         
         timer_type="old"
         timer.min_threads="4"
         timer.max_threads="10"
         timer.keep_alive_time="3000"
         timer.queue_max_size="500"         
         thread_pool.enabled="true"
         thread_pool.min_threads="1"
         thread_pool.max_threads="10"
         thread_pool.keep_alive_time="5000"
         thread_pool.queue_enabled="false"
         thread_pool.queue_max_size="100"
         thread_pool.rejection_policy="discard"         
         oob_thread_pool.enabled="true"
         oob_thread_pool.min_threads="1"
         oob_thread_pool.max_threads="8"
         oob_thread_pool.keep_alive_time="5000"
         oob_thread_pool.queue_enabled="false"
         oob_thread_pool.queue_max_size="100"
         oob_thread_pool.rejection_policy="discard"/>     
         
     <JDBC_PING connection_url="jdbc:mysql://my_db_instance/my_db"
        connection_username="root"
        connection_password="password"
        connection_driver="com.mysql.jdbc.Driver" />
       
     <MERGE2  min_interval="10000"
             max_interval="30000"/>
    <FD_SOCK/>
    <FD timeout="3000" max_tries="3" />
    <VERIFY_SUSPECT timeout="1500"  />
    <BARRIER />
    <pbcast.NAKACK2 use_mcast_xmit="false"
                   discard_delivered_msgs="true"/>
    <UNICAST />
    <pbcast.STABLE stability_delay="1000" desired_avg_gossip="50000"
                   max_bytes="4M"/>
    <pbcast.GMS print_local_addr="true" join_timeout="3000"
                view_bundling="true"/>
    <UFC max_credits="2M"
         min_threshold="0.4"/>
    <MFC max_credits="2M"
         min_threshold="0.4"/>
    <FRAG2 frag_size="60K"  />
    <pbcast.STATE_TRANSFER/></config>
---------------------------------------------------------------------------------------------------------------------------

I am using JDBC ping in tcp.xml, since the multicast communication within the liferay cluster is not allowed within, AWS VPC.This setting creates a table in portal DB in the name of JGROUPSPING, and maintains the details of available nodes in the cluster.
The servers are starting without any errors, 

node:1

09:17:47,079 INFO  [localhost-startStop-1][ClusterBase:167] Autodetecting JGroups outgoing IP address and interface for <mydatabase>:3306
09:17:47,082 INFO  [localhost-startStop-1][ClusterBase:183] Setting JGroups outgoing IP address to <myserverip> and interface to eth0
-------------------------------------------------------------------
GMS: address=ip-10-102-121-230-9298, cluster=liferay-channel-control, physical address=<myserverip>:7800
-------------------------------------------------------------------
09:15:48,455 INFO  [localhost-startStop-1][BaseReceiver:83] Accepted view [<ip_of_node1>-31909|0] [<ip_of_node1>-31909]
-------------------------------------------------------------------
GMS: address=ip-10-102-121-230-11362, cluster=liferay-channel-transport-0, physical address=<myserverip>:7800
-------------------------------------------------------------------
...


node:2

Same logs as above. except a change in this line. when i start the second server, it recognizes the ip of the already existing server in the cluster.

09:17:47,467 INFO  [localhost-startStop-1][BaseReceiver:83] Accepted view [<ip_of_node1>-31909|1] [<ip_of_node1>-31909, <ip_of_node2>-9298]

What is working ?

 

  1. When i create a user in node1 - it is immediately reflecting in node 2
  2. When i create a role in node-1 - it is immediately reflecting in node 2


What is not working?

 

 

  1. when i create a blank site in node-1 - It is not reflecting in node 2 for at least 10 mins. 
  2. When i add a portlet to a page in node-1. It is not getting added to the same page in node 2 automatically.
  3. We have not added our custom portlets and tested the above scenario, although there are a lot of search containers there in custom portlets.

 


Help needed with below questions:

 

 

  1. Am i testing the hibernate replication correct? If yes, why the site created is not reflecting?
  2. My expectation of portlets getting added to a page in node 2 automatically is correct?
  3. Do i need to deploy any portlets in both the nodes all the time? or is there a way to deploy it just in one node and get it replicated automatically.?


We followed this blog to understand the AWS specific cases, https://blog.trenddevs.co.uk/2015/06/aws-liferay-cluster-auto-scaling-capable.html

 

Pidugu Sundeep, modified 2 Years ago.

RE: Liferay 6.2 CE Clustering in AWS - Cache not syncing everywhere.

New Member Posts: 4 Join Date: 7/2/20 Recent Posts

Did you manage to find a solution for the same?