Commit 6300d33d authored by Luca Cinquini's avatar Luca Cinquini
Browse files

Reducing memory to fix problem with continuos Tomcat restarts

parent d1d42102
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
#!/bin/bash
# Default script to start Tomcat inside a container

# start Tomcat in the background (so it can be restarted without stopping the container)
# note: additional startup parameters are read from bin/setenv.sh
$CATALINA_HOME/bin/catalina.sh start

# keep container running by printing log to standard output
logfile=/usr/local/tomcat/logs/catalina.out
while ! [ -f $logfile ];
do
    sleep 1
done
tail -f $logfile
+22 −0
Original line number Diff line number Diff line
#!/bin/bash
# Script to start ESGF IdP

# Must first wait untill connection to the Postgres container is ready
export PGPASSWORD=`cat /esg/config/.esg_pg_pass`
while ! psql -h esgf-postgres -U dbsuper -d esgcet -c "select 1" > /dev/null 2>&1; do
        echo 'Waiting for connection with postgres...'
        sleep 1;
done;
echo 'Connected to postgres...'

# start Tomcat in the background (so it can be restarted without stopping the container)
# note: additional startup parameters are read from bin/setenv.sh
$CATALINA_HOME/bin/catalina.sh start

# keep container running by printing log to standard output
logfile=/usr/local/tomcat/logs/catalina.out
while ! [ -f $logfile ];
do
    sleep 1
done
tail -f $logfile
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ COPY conf/context.xml /usr/local/tomcat/conf/context.xml
COPY certs/ /esg/config/tomcat/

# custom env variables for starting Tomcat
COPY bin/setenv.sh $CATALINA_HOME/bin
COPY conf/setenv.sh $CATALINA_HOME/bin

# create non-privilged user to run Tomcat
RUN groupadd tomcat

tomcat/bin/setenv.sh

deleted100644 → 0
+0 −6
Original line number Diff line number Diff line
#!/bin/bash
# script containing env variables for starting ESGF Tomcat

export JAVA_OPTS="-Dtds.content.root.path=/esg/content"
#export JAVA_OPTS="-Djavax.net.debug=ssl -Dtds.content.root.path=/esg/content"
export CATALINA_OPTS="-Xmx2048m -server -Xms1024m -XX:MaxPermSize=512m -Dsun.security.ssl.allowUnsafeRenegotiation=false -Djavax.net.ssl.trustStore='/esg/config/tomcat/esg-truststore.ts' -Djavax.net.ssl.trustStorePassword='changeit'"

tomcat/conf/setenv.sh

0 → 100644
+8 −0
Original line number Diff line number Diff line
#!/bin/bash
# script containing env variables for starting ESGF Tomcat

export JAVA_OPTS="-Dtds.content.root.path=/esg/content"
#export JAVA_OPTS="-Djavax.net.debug=ssl -Dtds.content.root.path=/esg/content"
#export CATALINA_OPTS="-Xmx2048m -server -Xms1024m -XX:MaxPermSize=512m -Dsun.security.ssl.allowUnsafeRenegotiation=false -Djavax.net.ssl.trustStore='/esg/config/tomcat/esg-truststore.ts' -Djavax.net.ssl.trustStorePassword='changeit'"
# IMPORTANT : when running on single host, Tomcat will be killed if it exceeds the memory limits
export CATALINA_OPTS="-Xmx512m -server -Xms512m -XX:MaxPermSize=512m -Dsun.security.ssl.allowUnsafeRenegotiation=false -Djavax.net.ssl.trustStore='/esg/config/tomcat/esg-truststore.ts' -Djavax.net.ssl.trustStorePassword='changeit'"