0

I was trying to run Liferay as a Docker Container. As soon as I create a custom tomcat/conf/server.xml and copy that into the image Elasticsearch fails to start.

Does someone have an idea what is going on?

My Dockerfile:

FROM liferay/portal:7.1.3-ga4

COPY --chown=liferay:liferay bundles/osgi/modules /opt/liferay/osgi/modules
COPY --chown=liferay:liferay docker/portal-setup-wizard.properties docker/portal-ext.properties \
        /opt/liferay/
COPY --chown=liferay:liferay docker/cors-filter-2.5.jar docker/java-property-utils-1.9.1.jar \
        /opt/liferay/tomcat-9.0.17/webapps/ROOT/WEB-INF/lib/
COPY --chown=liferay:liferay docker/web.xml /opt/liferay/tomcat-9.0.17/webapps/ROOT/WEB-INF
COPY --chown=liferay:liferay docker/user_default.png /opt/liferay/tomcat-9.0.17/webapps/ROOT/WEB-INF/classes/com/images/user_default.png
COPY --chown=liferay:liferay docker/server.xml /opt/liferay/tomcat-9.0.17/conf

The server.xml only has this modification:

<Connector port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   maxPostSize="20971520"
                   redirectPort="8443" URIEncoding="UTF-8" />
Victor
  • 3,520
  • 3
  • 38
  • 58
purzel
  • 138
  • 2
  • 15
  • 1. run elasticsearch in a separate JVM/Container in production systems, 2. show logs: "elasticsearch fails to start" most likely means that there are some logs. Without that, few people might have an idea what is going on. – Olaf Kock Jul 22 '19 at 15:21
  • definitely, we need logs here, I would be really surprised be a change like what you expose could crash ES. Quick question too, are you trying to use the ES that is embedded into liferay? – Victor Jul 22 '19 at 20:59
  • I previously had an embedded elasticsearch. But as elasticsearch should be run as a seperate cluster/instance anyway, I created an environment that just did that. – purzel Jul 26 '19 at 08:12

1 Answers1

0

I tested the configuration you mentioned, and it seems you are blaming the wrong guys.

Using your sample as the only change with the tag you provided:

<Connector port="8080" protocol="HTTP/1.1"
                   connectionTimeout="20000"
                   maxPostSize="20971520"
                   redirectPort="8443" URIEncoding="UTF-8" />

I got:

Using CATALINA_BASE:   /opt/liferay/tomcat
Using CATALINA_HOME:   /opt/liferay/tomcat
Using CATALINA_TMPDIR: /opt/liferay/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/zulu-8
Using CLASSPATH:       /opt/liferay/tomcat/bin/bootstrap.jar:/opt/liferay/tomcat/bin/tomcat-juli.jar
22-Jul-2019 21:10:54.055 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [942] milliseconds
Loading jar:file:/opt/liferay/tomcat-9.0.17/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
Loading jar:file:/opt/liferay/tomcat-9.0.17/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
2019-07-22 21:10:55.654 INFO  [main][PortalContextLoaderListener:139] JVM arguments: -Djava.util.logging.config.file=/opt/liferay/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dfile.encoding=UTF8 -Djava.net.preferIPv4Stack=true -Duser.timezone=GMT -Xms2560m -Xmx2560m -XX:MaxNewSize=1536m -XX:MaxMetaspaceSize=512m -XX:MetaspaceSize=512m -XX:NewSize=1536m -XX:SurvivorRatio=7 -Dignore.endorsed.dirs= -Dcatalina.base=/opt/liferay/tomcat -Dcatalina.home=/opt/liferay/tomcat -Djava.io.tmpdir=/opt/liferay/tomcat/temp
2019-07-22 21:10:58.689 WARN  [main][DialectDetector:100] Liferay is configured to use Hypersonic as its database. Do NOT use Hypersonic in production. Hypersonic is an embedded database useful for development and demonstration purposes. The database settings can be changed in portal-ext.properties.
2019-07-22 21:10:58.695 INFO  [main][DialectDetector:158] Using dialect com.liferay.portal.dao.orm.hibernate.HSQLDialect for HSQL Database Engine 2.3
2019-07-22 21:11:00.507 INFO  [main][ModuleFrameworkImpl:1334] Starting initial bundles
2019-07-22 21:11:01.586 INFO  [main][ModuleFrameworkImpl:1611] Started initial bundles
2019-07-22 21:11:01.587 INFO  [main][ModuleFrameworkImpl:1646] Starting dynamic bundles
2019-07-22 21:11:08.824 INFO  [main][ModuleFrameworkImpl:1743] Started dynamic bundles
2019-07-22 21:11:08.826 INFO  [main][ModuleFrameworkImpl:412] Navigate to Control Panel > Configuration > Gogo Shell and enter "lb" to see all bundles
2019-07-22 21:11:15.778 WARN  [Elasticsearch initialization thread][EmbeddedElasticsearchConnection:288] Liferay is configured to use embedded Elasticsearch as its search engine. Do NOT use embedded Elasticsearch in production. Embedded Elasticsearch is useful for development and demonstration purposes. Refer to the documentation for details on the limitations of embedded Elasticsearch. Remote Elasticsearch connections can be configured in the Control Panel.

    __    ____________________  _____  __
   / /   /  _/ ____/ ____/ __ \/   \ \/ /
  / /    / // /_  / __/ / /_/ / /| |\  /
 / /____/ // __/ / /___/ _, _/ ___ |/ /
/_____/___/_/   /_____/_/ |_/_/  |_/_/

Starting Liferay Community Edition Portal 7.1.3 CE GA4 (Judson / Build 7102 / May 14, 2019)

2019-07-22 21:11:22.651 INFO  [main][StartupHelper:72] There are no patches installed
Loading jar:file:/opt/liferay/tomcat-9.0.17/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
2019-07-22 21:11:24.176 INFO  [main][AutoDeployDir:193] Auto deploy scanner started for /opt/liferay/deploy
2019-07-22 21:11:47.310 INFO  [main][ThemeHotDeployListener:108] 1 theme for admin-theme is available for use
2019-07-22 21:11:47.638 INFO  [main][ThemeHotDeployListener:108] 1 theme for classic-theme is available for use
2019-07-22 21:11:49.775 INFO  [main][SystemCheckOSGiCommands:54] System check is enabled. You can run a system check with the command "system:check" in Gogo shell.
22-Jul-2019 21:11:51.238 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [57,178] milliseconds
Victor
  • 3,520
  • 3
  • 38
  • 58