andrekramer1 opened a new issue #9150:
URL: https://github.com/apache/pulsar/issues/9150


   The kubernetes templates use:
   
   apply-config-from-env.py conf/pulsar_env.sh
   
   to convert PULSAR_ configuration into environment variables using:
   
   Recently pulsar_env.sh was modified to contain an if statement:
   
   # Garbage collection log.
   IS_JAVA_8=`java -version 2>&1 |grep version|grep '"1\.8'`
   # java version has space, use [[ -n $PARAM ]] to judge if variable exists
   if [[ -n $IS_JAVA_8 ]]; then
     PULSAR_GC_LOG=${PULSAR_GC_LOG:-"-Xloggc:logs/pulsar_gc_%p.log 
-XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation 
-XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=20M"}
   else
   # After jdk 9, gc log param should config like this. Ignoring version less 
than jdk 8
     
PULSAR_GC_LOG=${PULSAR_GC_LOG:-"-Xlog:gc:logs/pulsar_gc_%p.log:time,uptime:filecount=10,filesize=20M"}
   fi
   
   the apply-config-from-env.py scripts expects input files to only contain 
commented lines or lines in the form X=Y 
   and so fails on splitting teh "if [[" line on the expected "=".
   
   **To Reproduce**
   Kubernetes deployment using Apache Pulsar 2.7.0. The broker pods fail to 
start up. The start up command includes 
   apply-config-from-env.py conf/pulsar_env.sh
   
   The python apply_*.py  script fails on the result of splitting the lines 
recently added to pulsar_env.sh
   
   One way to address this would be to factor our the if statement which just 
sets up one PULSAR_LOG variable into a separate config file pulsar_log.conf and 
have two copies of that (pulsar_log.conf and pulsar_log_java8.conf) - one for 
Java 8 and one for more recent Java versions. 
   
   By the way it's confusing & error prone to use a shell .sh file as a config 
file and expect it to be limited to var assignments.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to