mirror of https://github.com/apache/lucene.git
SOLR-8689: Fix bin/solr.cmd so it can run properly on Java 9
This commit is contained in:
parent
25bbd2512e
commit
86f7d6779a
|
@ -296,6 +296,10 @@ Upgrading from Solr 6.x
|
|||
* V2 APIs are now available at /api, in addition to /v2 (which is now deprecated). Legacy APIs continue to remain
|
||||
available at /solr.
|
||||
|
||||
* Solr was tested and is compatible with the final release candidate of Java 9. All startup scripts
|
||||
detect Java 9 correctly and setup Garbage Collector logging. If the configuration file contains
|
||||
logging options that are no longer supported with Java 9, startup will fail.
|
||||
|
||||
New Features
|
||||
----------------------
|
||||
* SOLR-9857, SOLR-9858: Collect aggregated metrics from nodes and shard leaders in overseer. (ab)
|
||||
|
@ -473,6 +477,8 @@ Bug Fixes
|
|||
|
||||
* SOLR-11268: AtomicUpdateProcessor complains missing UpdateLog (noble, Ishan Chattopadhyaya)
|
||||
|
||||
* SOLR-8689: Fix bin/solr.cmd so it can run properly on Java 9 (Uwe Schindler, hossman)
|
||||
|
||||
Optimizations
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -1113,14 +1113,28 @@ IF "%GC_TUNE%"=="" (
|
|||
-XX:-OmitStackTraceInFastThrow
|
||||
)
|
||||
|
||||
IF "%GC_LOG_OPTS%"=="" (
|
||||
set GC_LOG_OPTS=-verbose:gc ^
|
||||
-XX:+PrintHeapAtGC ^
|
||||
-XX:+PrintGCDetails ^
|
||||
-XX:+PrintGCDateStamps ^
|
||||
-XX:+PrintGCTimeStamps ^
|
||||
-XX:+PrintTenuringDistribution ^
|
||||
-XX:+PrintGCApplicationStoppedTime
|
||||
if !JAVA_MAJOR_VERSION! GEQ 9 (
|
||||
IF NOT "%GC_LOG_OPTS%"=="" (
|
||||
echo ERROR: On Java 9 you cannot set GC_LOG_OPTS, only default GC logging is available. Exiting
|
||||
GOTO :eof
|
||||
)
|
||||
set GC_LOG_OPTS="-Xlog:gc*:file=\"!SOLR_LOGS_DIR!\solr_gc.log\":time,uptime:filecount=9,filesize=20000"
|
||||
) else (
|
||||
IF "%GC_LOG_OPTS%"=="" (
|
||||
rem Set defaults for Java 8
|
||||
set GC_LOG_OPTS=-verbose:gc ^
|
||||
-XX:+PrintHeapAtGC ^
|
||||
-XX:+PrintGCDetails ^
|
||||
-XX:+PrintGCDateStamps ^
|
||||
-XX:+PrintGCTimeStamps ^
|
||||
-XX:+PrintTenuringDistribution ^
|
||||
-XX:+PrintGCApplicationStoppedTime
|
||||
)
|
||||
if "%JAVA_VENDOR%" == "IBM J9" (
|
||||
set GC_LOG_OPTS=!GC_LOG_OPTS! "-Xverbosegclog:!SOLR_LOGS_DIR!\solr_gc.log" -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M
|
||||
) else (
|
||||
set GC_LOG_OPTS=!GC_LOG_OPTS! "-Xloggc:!SOLR_LOGS_DIR!\solr_gc.log" -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M
|
||||
)
|
||||
)
|
||||
|
||||
IF "%verbose%"=="1" (
|
||||
|
@ -1207,26 +1221,20 @@ IF NOT EXIST "%SOLR_SERVER_DIR%\tmp" (
|
|||
mkdir "%SOLR_SERVER_DIR%\tmp"
|
||||
)
|
||||
|
||||
IF "%JAVA_VENDOR%" == "IBM J9" (
|
||||
set GCLOG_OPT="-Xverbosegclog:!SOLR_LOGS_DIR!\solr_gc.log" -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M
|
||||
) else (
|
||||
set GCLOG_OPT="-Xloggc:!SOLR_LOGS_DIR!\solr_gc.log" -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=9 -XX:GCLogFileSize=20M
|
||||
)
|
||||
|
||||
IF "%DEFAULT_CONFDIR%"=="" set "DEFAULT_CONFDIR=%SOLR_SERVER_DIR%\solr\configsets\_default\conf"
|
||||
|
||||
IF "%FG%"=="1" (
|
||||
REM run solr in the foreground
|
||||
title "Solr-%SOLR_PORT%"
|
||||
echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port
|
||||
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% %GCLOG_OPT% ^
|
||||
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% ^
|
||||
-Dlog4j.configuration="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
|
||||
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%" ^
|
||||
-Djetty.host=%SOLR_JETTY_HOST% -Djetty.port=%SOLR_PORT% -Djetty.home="%SOLR_SERVER_DIR%" ^
|
||||
-Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar "%SOLR_JETTY_CONFIG%" "%SOLR_JETTY_ADDL_CONFIG%"
|
||||
) ELSE (
|
||||
START /B "Solr-%SOLR_PORT%" /D "%SOLR_SERVER_DIR%" ^
|
||||
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% %GCLOG_OPT% ^
|
||||
"%JAVA%" %SERVEROPT% %SOLR_JAVA_MEM% %START_OPTS% ^
|
||||
-Dlog4j.configuration="%LOG4J_CONFIG%" -DSTOP.PORT=!STOP_PORT! -DSTOP.KEY=%STOP_KEY% ^
|
||||
-Dsolr.log.muteconsole ^
|
||||
-Dsolr.solr.home="%SOLR_HOME%" -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%" ^
|
||||
|
@ -1843,8 +1851,12 @@ FOR /f "usebackq tokens=3" %%a IN (`^""%JAVA%" -version 2^>^&1 ^| findstr "versi
|
|||
set JAVA_VERSION_INFO=!JAVA_VERSION_INFO:"=!
|
||||
|
||||
REM Extract the major Java version, e.g. 7, 8, 9, 10 ...
|
||||
for /f "tokens=2 delims=." %%a in ("!JAVA_VERSION_INFO!") do (
|
||||
set JAVA_MAJOR_VERSION=%%a
|
||||
for /f "tokens=1,2 delims=." %%a in ("!JAVA_VERSION_INFO!") do (
|
||||
if "%%a" GEQ "9" (
|
||||
set JAVA_MAJOR_VERSION=%%a
|
||||
) else (
|
||||
set JAVA_MAJOR_VERSION=%%b
|
||||
)
|
||||
)
|
||||
|
||||
REM Don't look for "_{build}" if we're on IBM J9.
|
||||
|
|
|
@ -27,7 +27,9 @@ REM set SOLR_JAVA_HOME=
|
|||
REM Increase Java Min/Max Heap as needed to support your indexing / query needs
|
||||
REM set SOLR_JAVA_MEM=-Xms512m -Xmx512m
|
||||
|
||||
REM Enable verbose GC logging
|
||||
REM Configure verbose GC logging:
|
||||
REM For Java 8: if this is set, additional params will be added to specify the log file & rotation
|
||||
REM For Java 9 or higher: GC_LOG_OPTS is currently not supported. If you set it, the startup script will exit with failure.
|
||||
REM set GC_LOG_OPTS=-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime
|
||||
|
||||
REM Various GC settings have shown to work well for a number of common Solr workloads.
|
||||
|
|
|
@ -36,12 +36,12 @@
|
|||
|
||||
# Enable verbose GC logging...
|
||||
# * If this is unset, various default options will be selected depending on which JVM version is in use
|
||||
# * For java8 or lower: if this is set, additional params will be added to specify the log file & rotation
|
||||
# * For java9 or higher: each included opt param that starts with '-Xlog:gc', but does not include an output
|
||||
# specifier, will have a 'file' output specifier (as well as formatting & rollover options) appended,
|
||||
# using the effective value of the SOLR_LOGS_DIR.
|
||||
# * For Java 8: if this is set, additional params will be added to specify the log file & rotation
|
||||
# * For Java 9 or higher: each included opt param that starts with '-Xlog:gc', but does not include an
|
||||
# output specifier, will have a 'file' output specifier (as well as formatting & rollover options)
|
||||
# appended, using the effective value of the SOLR_LOGS_DIR.
|
||||
#
|
||||
#GC_LOG_OPTS='-Xlog:gc*' # (java9)
|
||||
#GC_LOG_OPTS='-Xlog:gc*' # (Java 9+)
|
||||
#GC_LOG_OPTS="-verbose:gc -XX:+PrintHeapAtGC -XX:+PrintGCDetails \
|
||||
# -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime"
|
||||
|
||||
|
|
Loading…
Reference in New Issue