Last active
September 10, 2018 08:37
-
-
Save jayankandathil/47bf5113d91e42903ddb to your computer and use it in GitHub Desktop.
Adobe AEM 6.1 Windows start.bat for Java 8 (assumes 15 GB vRAM and 8 vCPUs)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: This script configures the start information for this server. | |
setlocal | |
::* TCP port used for stop and status scripts | |
set CQ_PORT=4502 | |
::* runmode(s) | |
::* will not be used if repository is already present | |
set CQ_RUNMODE=author,prod,nosamplecontent | |
::* ------------------- | |
::* Default JVM options | |
::* ------------------- | |
set CQ_JVM_OPTS=-server | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Djava.awt.headless=true | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Xms8192m | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Xmx8192m | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:MaxMetaspaceSize=512m | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:NewRatio=1 | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:MaxTenuringThreshold=15 | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+UseConcMarkSweepGC | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:ConcGCThreads=4 | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:ParallelGCThreads=4 | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Djava.io.tmpdir=C:\JAVA_TEMP\author | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:+HeapDumpOnOutOfMemoryError | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -XX:HeapDumpPath=C:\JAVA_TEMP\author | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Doak.queryLimitInMemory=500000 | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Doak.queryLimitReads=100000 | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dupdate.limit=250000 | |
set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Doak.fastQuerySize=true | |
::* ------------------------------------------------------------------------------ | |
::* authentication | |
::* ------------------------------------------------------------------------------ | |
::* when using oak (crx3) authentication must be configured using the | |
::* Apache Felix JAAS Configuration Factory service via the Web Console | |
::* see http://jackrabbit.apache.org/oak/docs/security/authentication/externalloginmodule.html | |
::* use jaas.config (legacy: only used for crx2 persistence) | |
:: if not defined CQ_USE_JAAS set CQ_USE_JAAS=true | |
::* config for jaas (legacy: only used for crx2 persistence) | |
if not defined CQ_JAAS_CONFIG set CQ_JAAS_CONFIG=etc\jaas.config | |
::* ------------------------------------------------------------------------------ | |
::* persistence mode | |
::* ------------------------------------------------------------------------------ | |
::* the persistence mode can not be switched for an existing repository | |
set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3tar | |
:: set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3mongo | |
::* settings for mongo db | |
:: if not defined CQ_MONGO_HOST set CQ_MONGO_HOST=127.0.0.1 | |
:: if not defined CQ_MONGO_PORT set CQ_MONGO_PORT=27017 | |
:: if not defined CQ_MONGO_DB set CQ_MONGO_DB=aem6 | |
::* ------------------------------------------------------------------------------ | |
::* do not configure below this point | |
::* ------------------------------------------------------------------------------ | |
chdir /D %~dp0 | |
cd .. | |
del conf\controlport | |
if not defined CQ_JARFILE for %%X in (app\*.jar) do set CQ_JARFILE=%%X | |
for %%* in (.) do set CurrDirName=%%~n* | |
cd .. | |
set START_OPTS=start -c %CurrDirName% -i launchpad | |
if defined CQ_PORT set START_OPTS=%START_OPTS% -p %CQ_PORT% | |
if defined CQ_RUNMODE set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dsling.run.modes=%CQ_RUNMODE% | |
if defined CQ_HOST set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Dorg.apache.felix.http.host=%CQ_HOST% | |
if defined CQ_HOST set START_OPTS=%START_OPTS% -a %CQ_HOST% | |
if defined CQ_MONGO_HOST set START_OPTS=%START_OPTS% -Doak.mongo.host=%CQ_MONGO_HOST% | |
if defined CQ_MONGO_PORT set START_OPTS=%START_OPTS% -Doak.mongo.port=%CQ_MONGO_PORT% | |
if defined CQ_MONGO_DB set START_OPTS=%START_OPTS% -Doak.mongo.db=%CQ_MONGO_DB% | |
if defined CQ_USE_JAAS set CQ_JVM_OPTS=%CQ_JVM_OPTS% -Djava.security.auth.login.config=%CQ_JAAS_CONFIG% | |
set START_OPTS=%START_OPTS% -Dsling.properties=conf/sling.properties | |
tasklist > oldTaskList.txt | |
start "CQ" cmd.exe /K java %CQ_JVM_OPTS% -jar %CurrDirName%\%CQ_JARFILE% %START_OPTS% | |
tasklist > newTaskList.txt | |
java -cp %~dp0 GetProcessID oldTaskList.txt newTaskList.txt java.exe > %CurrDirName%\conf\cq.pid | |
del newTaskList.txt | |
del oldTaskList.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
does this script also be applied for a JDK7 installation?
Att.