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

Manual configuration for lucene/dump is being overwritten by the automatic detection causing errors

    Details

      Description

      Manual configuration related about the instance port and protocol in cluster environment is being overwriting by the automatic mechanism causing that Lucene/Dump fails

      The environment for reproduce it doesn't need all the nodes configured, so, I added only the configuration for only one node.

      ENVIRONMENT

      Configure a cluster with Mod Proxy Ajp, in my case I have deployed ehcache-web and the next configuration:

      NODE 1

      The node is configured in localhost to simplify the Apache WebServer configuration.

      Node 1: portal-ext.properties
      cluster.link.enabled=true
      ehcache.cluster.link.replication.enabled=true
      lucene.replicate.write=true
      browser.launcher.url=
      portal.instance.protocol=http
      portal.instance.http.port=8080
      
      • Configure the Apache web server via ajp having the next VirtualHosts:
      Node 1: d1.jose.com
      <VirtualHost *:80>
         ServerName d1.jose.com
         ServerAdmin webmaster@localhost
         ErrorLog /var/log/apache2/ajp.nodo1.error.log
         CustomLog /var/log/apache2/ajp.nodo1.log combined
      
         <Proxy *>
           AddDefaultCharset Off
           Order deny,allow
           Allow from all
         </Proxy>
      
         ProxyPass / ajp://localhost:8009/
         ProxyPassReverse / ajp://localhost:8009/
         ProxyErrorOverride On
      </VirtualHost>
      

      STEPS TO REPRODUCE HAVING THAT ENVIRONMENT

      1. Start node 1.
      2. Go to http://d1.jose.com (important! the first request must not be localhost:8080)
      3. Login as superadmin and run the next Groovy Script:

      Script
      out.println("portal.instance.protocol=" +com.liferay.portal.util.PropsValues.PORTAL_INSTANCE_PROTOCOL);
      out.println("portal.instance.http.port="+ com.liferay.portal.util.PropsValues.PORTAL_INSTANCE_HTTP_PORT);
      out.println()
      
      for(def node: com.liferay.portal.kernel.cluster.ClusterExecutorUtil.getClusterNodes()) {
          out.println(node)
      }
      

      Result Cluster node port for the node 1 is 80

      portal.instance.protocol=http
      portal.instance.http.port=8080
      
      {clusterNodeId=f96c85f7-b08c-4960-8c55-4942e8596fb9, portalProtocol=http, inetAddress=/127.0.0.1, port=80}
      

      Expected Cluster node port for the node 1 is 8080 as it was configured in properties, the result will be like:

      portal.instance.protocol=http
      portal.instance.http.port=8080
      
      {clusterNodeId=ae66ca6e-4b79-47c8-949e-bd4c2b345c5a, portalProtocol=http, inetAddress=/127.0.0.1, port=8080}
      

      NOTES

      A similar issue happens if you also have enabled https in both nodes, and you have http and https traffic, causing errors when the second node starts or after a manual reindex from the control panel.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 17 weeks, 6 days ago

                  Packages

                  Version Package
                  6.1.X EE
                  6.2.4 CE GA5
                  6.2.X EE