Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-55644

Expand Elasticsearch replicas with Liferay cluster nodes

    Details

      Description

      Out of the box, Elasticsearch with Liferay's cluster enabled (cluster.link) will automatically create a replica as nodes are added into the network.

      1. Setup two Liferay bundles for clustering
        • Modify the server configuration port of the second bundle to 9080
        • Modify the portal ext to point to the same database and include the following for both bundles
          cluster.link.enabled=true
          
          cluster.link.channel.system.properties=\
          	#
          	# Common
          	#
          	\
          	jgroups.bind_addr:${cluster.link.bind.addr["cluster-link-udp"]},\
          	jgroups.bind_interface:127.0.0.1,\
          	\
          	#
          	# Multicast
          	#
          	\
          	jgroups.mping.mcast_addr:${multicast.group.address["cluster-link-mping"]},\
          	jgroups.mping.mcast_port:${multicast.group.port["cluster-link-mping"]},\
          	jgroups.mping.ip_ttl:8
          
          web.server.display.node=true
          
      2. Asset Portal starts up and is clustered
      3. Navigate to Elasticsearch JSON Rest API to assert the replicas has been added. Note the increment in the port number 9200, 9201, 9203, etc corresponds to the number of nodes and consequently the number of replicas as there is a one to one relationship.
        • http://localhost:9200/_cluster/health?pretty=true
          {
            "cluster_name" : "LiferayElasticSearch",
            "status" : "green",
            "timed_out" : false,
            "number_of_nodes" : 2,
            "number_of_data_nodes" : 2,
            "active_primary_shards" : 2,
            "active_shards" : 3,
            "relocating_shards" : 0,
            "initializing_shards" : 0,
            "unassigned_shards" : 0,
            "number_of_pending_tasks" : 0,
            "number_of_in_flight_fetch" : 0
          }
          
        • http://localhost:9201/_cluster/health?pretty=true
          {
            "cluster_name" : "LiferayElasticSearch",
            "status" : "green",
            "timed_out" : false,
            "number_of_nodes" : 2,
            "number_of_data_nodes" : 2,
            "active_primary_shards" : 2,
            "active_shards" : 3,
            "relocating_shards" : 0,
            "initializing_shards" : 0,
            "unassigned_shards" : 0,
            "number_of_pending_tasks" : 0,
            "number_of_in_flight_fetch" : 0
          }
          
      4. You can also assert that the replicas are being added and removed in the console output:
        Anomalito is the portal instance at port 8080 and Maynard Tibold is the portal instance at port 9080
        • Replica added:
          15:51:49,530 INFO  [elasticsearch[Anomalito][clusterService#updateTask][T#1]][service:450] [Anomalito] added {[Maynard Tiboldt][i3mxSvVfQIm6JWoT3QF5Zg][ayame][inet[/172.16.19.11:9301]]{local=false},}, reason: zen-disco-receive(join from node[[Maynard Tiboldt][i3mxSvVfQIm6JWoT3QF5Zg][ayame][inet[/172.16.19.11:9301]]{local=false}])
          15:52:56,416 INFO  [default-9][ClusterExecutorImpl:551] Updated cluster node {bindInetAddress=/172.16.19.11, clusterNodeId=ff752018-7eb8-fe0b-4ca0-c0eca0914550, portalInetSocketAddress=/127.0.0.1:9080, portalProtocol=http}
          
        • Replica removed:
          16:16:12,768 INFO  [elasticsearch[Anomalito][clusterService#updateTask][T#1]][service:450] [Anomalito] removed {[Maynard Tiboldt][i3mxSvVfQIm6JWoT3QF5Zg][ayame][inet[/172.16.19.11:9301]]{local=false},}, reason: zen-disco-node_left([Maynard Tiboldt][i3mxSvVfQIm6JWoT3QF5Zg][ayame][inet[/172.16.19.11:9301]]{local=false})
          

        Attachments

          Activity

            People

            Assignee:
            albert.lee Albert Lee
            Reporter:
            andre.oliveira André Ricardo Barreto de Oliveira
            Recent user:
            Kiyoshi Lee
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Packages

                Version Package
                7.0.0 M6