Liferay 6.2 CE Clustering in AWS - Cache not syncing everywhere.Liferay 6.2 CE Clustering in AWS - Cache not syncing everywhere.https://liferay.dev/en/c/message_boards/find_thread?p_l_id=119785333&threadId=1193416312024-03-29T06:41:07Z2024-03-29T06:41:07ZRE: Liferay 6.2 CE Clustering in AWS - Cache not syncing everywhere.Pidugu Sundeephttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1208429232021-06-22T07:43:55Z2021-06-22T06:21:18Z<p>Did you manage to find a solution for the same?</p>Pidugu Sundeep2021-06-22T06:21:18ZLiferay 6.2 CE Clustering in AWS - Cache not syncing everywhere.Navaneethakrishnan Natarajanhttps://liferay.dev/en/c/message_boards/find_message?p_l_id=119785333&messageId=1193416302021-08-17T16:23:17Z2020-06-09T10:30:09Z<p>
<strong>Environment: Liferay 6.2 CE GA6 with tomcat bundle, Hosted on
AWS EC2 instances, using AWS RDS MySQL, Load balanced through AWS ELB.</strong>
<br />
<br /> Hi,<br /> We are trying to configure Liferay cluster in AWS EC2
server, with Liferay ELB as the loadbalancer and RDS MySQL as the database.<br />
<br /> Below is our <strong>portal-ext.properties</strong>
configuration, <br />
--------------------------------------------------------------------------------------------------------------------------------------<br />
portal.instance.http.port=8080<br /> portal.instance.protocol=http<br />
<br /> cluster.link.enabled=true<br />
cluster.link.autodetect.address=liferayportal_db:3306<br />
cluster.link.channel.properties.control=/liferay-server/node-02/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/jgroups/tcp.xml<br />
cluster.link.channel.properties.transport.0=/liferay-server/node-02/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/jgroups/tcp.xml<br />
ehcache.bootstrap.cache.loader.factory=com.liferay.portal.cache.ehcache.JGroupsBootstrapCacheLoaderFactory<br />
ehcache.cache.event.listener.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory<br />
#ehcache.cache.manager.peer.provider.factory=net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory<br />
ehcache.cache.manager.peer.provider.factory=com.liferay.portal.cache.ehcache.JGroupsCacheManagerPeerProviderFactory<br />
transactional.cache.enable=true<br /> ehcache.cluster.link.replication.enabled=true<br />
<br />
ehcache.multi.vm.config.location.peerProviderProperties=clusterName=hibernate,channelProperties=/jgroups/tcp.xml<br />
ehcache.multi.vm.config.location=/ehcache/liferay-multi-vm-clustered.xml<br />
net.sf.ehcache.configurationResourceName.peerProviderProperties=clusterName=hibernate,channelProperties=/jgroups/tcp.xml<br />
net.sf.ehcache.configurationResourceName=/ehcache/hibernate-clustered.xml#ehcache.portal.cache.manager.jmx.enabled=true<br />
cluster.executor.debug.enabled=true<br />
web.server.display.node=true<br /> ---------------------------------------------------------------------------------------------------------------------------<br />
<br />
<strong>tcp.xml file contents,</strong>
<br />
<br />
-------------------------------------------------------------------------------------------------------<br />
<TCP singleton_name="jgroups"<br />
bind_port="7800"<br />
loopback="false"<br />
recv_buf_size="${tcp.recv_buf_size:5M}"<br />
send_buf_size="${tcp.send_buf_size:640K}"<br />
max_bundle_size="64K"<br />
max_bundle_timeout="30"<br />
enable_bundling="true"<br />
use_send_queues="true"<br />
sock_conn_timeout="300" <br />
timer_type="old"<br />
timer.min_threads="4"<br />
timer.max_threads="10"<br />
timer.keep_alive_time="3000"<br />
timer.queue_max_size="500" <br />
thread_pool.enabled="true"<br />
thread_pool.min_threads="1"<br />
thread_pool.max_threads="10"<br />
thread_pool.keep_alive_time="5000"<br />
thread_pool.queue_enabled="false"<br />
thread_pool.queue_max_size="100"<br />
thread_pool.rejection_policy="discard" <br />
oob_thread_pool.enabled="true"<br />
oob_thread_pool.min_threads="1"<br />
oob_thread_pool.max_threads="8"<br />
oob_thread_pool.keep_alive_time="5000"<br />
oob_thread_pool.queue_enabled="false"<br />
oob_thread_pool.queue_max_size="100"<br />
oob_thread_pool.rejection_policy="discard"/> <br />
<br /> <JDBC_PING
connection_url="jdbc:mysql://my_db_instance/my_db"<br />
connection_username="root"<br />
connection_password="password"<br />
connection_driver="com.mysql.jdbc.Driver" /><br />
<br /> <MERGE2 min_interval="10000"<br />
max_interval="30000"/><br />
<FD_SOCK/><br /> <FD timeout="3000"
max_tries="3" /><br /> <VERIFY_SUSPECT
timeout="1500" /><br /> <BARRIER /><br />
<pbcast.NAKACK2 use_mcast_xmit="false"<br />
discard_delivered_msgs="true"/><br />
<UNICAST /><br /> <pbcast.STABLE
stability_delay="1000"
desired_avg_gossip="50000"<br />
max_bytes="4M"/><br /> <pbcast.GMS
print_local_addr="true" join_timeout="3000"<br />
view_bundling="true"/><br /> <UFC
max_credits="2M"<br />
min_threshold="0.4"/><br /> <MFC
max_credits="2M"<br />
min_threshold="0.4"/><br /> <FRAG2
frag_size="60K" /><br />
<pbcast.STATE_TRANSFER/></config><br /> ---------------------------------------------------------------------------------------------------------------------------<br />
<br /> 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.<br /> The servers are starting without any errors, <br />
<br />
<strong>node:1</strong>
<br />
<br /> 09:17:47,079 INFO [localhost-startStop-1][ClusterBase:167]
Autodetecting JGroups outgoing IP address and interface for
<mydatabase>:3306<br /> 09:17:47,082 INFO
[localhost-startStop-1][ClusterBase:183] Setting JGroups outgoing IP
address to <myserverip> and interface to eth0<br />
-------------------------------------------------------------------<br />
GMS: address=ip-10-102-121-230-9298, cluster=liferay-channel-control,
physical address=<myserverip>:7800<br />
-------------------------------------------------------------------<br />
09:15:48,455 INFO [localhost-startStop-1][BaseReceiver:83] Accepted
view [<ip_of_node1>-31909|0] [<ip_of_node1>-31909]<br />
-------------------------------------------------------------------<br />
GMS: address=ip-10-102-121-230-11362,
cluster=liferay-channel-transport-0, physical
address=<myserverip>:7800<br />
-------------------------------------------------------------------<br /> ...<br />
<br />
<br />
<strong>node:2</strong>
<br />
<br /> 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.<br />
<br /> 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]<br />
<br />
<strong>What is working ?</strong></p>
<p> </p>
<ol style="list-style: decimal outside;">
<li>When i create a user in node1 - it is immediately reflecting in
node 2</li>
<li>When i create a role in node-1 - it is immediately reflecting in
node 2</li></ol>
<p>
<br />
<strong>What is not working?</strong></p>
<p> </p>
<p> </p>
<ol style="list-style: decimal outside;">
<li>when i create a blank site in node-1 - It is not reflecting in
node 2 for at least 10 mins. </li>
<li>When i add a portlet to a page in node-1. It is not getting added
to the same page in node 2 automatically.</li>
<li>We have not added our custom portlets and tested the above
scenario, although there are a lot of search containers there in
custom portlets.</li></ol>
<p> </p>
<p>
<br />
<strong>Help needed with below questions:</strong></p>
<p> </p>
<p> </p>
<ol style="list-style: decimal outside;">
<li>Am i testing the hibernate replication correct? If yes, why the
site created is not reflecting?</li>
<li>My expectation of portlets getting added to a page in node 2
automatically is correct?</li>
<li>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.?</li></ol>
<p>
<br /> We followed this blog to understand the AWS specific cases, <a href="https://blog.trenddevs.co.uk/2015/06/aws-liferay-cluster-auto-scaling-capable.html">https://blog.trenddevs.co.uk/2015/06/aws-liferay-cluster-auto-sc