From 3e452a3e4b37a9264a903860487241cad3e9ecf6 Mon Sep 17 00:00:00 2001 From: Li Zhanhui Date: Tue, 14 Feb 2017 19:36:45 +0800 Subject: [PATCH 1/9] Add tools.bat file --- bin/tools.bat | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bin/tools.bat diff --git a/bin/tools.bat b/bin/tools.bat new file mode 100644 index 00000000000..05330418ce0 --- /dev/null +++ b/bin/tools.bat @@ -0,0 +1,35 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & pause & exit 1 + +set "JAVA=%JAVA_HOME%\bin\java.exe" + +set BASE_DIR=%~dp0 +set BASE_DIR=%BASE_DIR:~0,-1% +for %%d in (%BASE_DIR%) do set BASE_DIR=%%~dpd + +set CLASSPATH=.;%BASE_DIR%conf;%CLASSPATH% + +rem =========================================================================================== +rem JVM Configuration +rem =========================================================================================== +set "JAVA_OPT=%JAVA_OPT% -server -Xms1g -Xmx1g -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=128m" +set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;%JAVA_HOME%\jre\lib\ext" +set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" +echo %* +%JAVA% %JAVA_OPT% %* + From 2f6fa2621f991e5284efddb1722a31e3fa2c50f4 Mon Sep 17 00:00:00 2001 From: Li Zhanhui Date: Tue, 14 Feb 2017 19:39:03 +0800 Subject: [PATCH 2/9] Add runserver.bat file --- bin/runserver.cmd | 15 +++++++++++++++ bin/tools.bat | 1 - 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 bin/runserver.cmd diff --git a/bin/runserver.cmd b/bin/runserver.cmd new file mode 100644 index 00000000000..538f8e16b70 --- /dev/null +++ b/bin/runserver.cmd @@ -0,0 +1,15 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. diff --git a/bin/tools.bat b/bin/tools.bat index 05330418ce0..f1a55b4034c 100644 --- a/bin/tools.bat +++ b/bin/tools.bat @@ -30,6 +30,5 @@ rem ============================================================================ set "JAVA_OPT=%JAVA_OPT% -server -Xms1g -Xmx1g -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=128m" set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;%JAVA_HOME%\jre\lib\ext" set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" -echo %* %JAVA% %JAVA_OPT% %* From 5e12f36dab39d462215413586906a24fc3a910ff Mon Sep 17 00:00:00 2001 From: Zhanhui Li Date: Wed, 15 Feb 2017 09:24:51 +0800 Subject: [PATCH 3/9] Add runbroker.cmd runserver.cmd --- bin/runbroker.cmd | 40 ++++++++++++++++++++++++++++++++++++++++ bin/runserver.cmd | 20 ++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 bin/runbroker.cmd diff --git a/bin/runbroker.cmd b/bin/runbroker.cmd new file mode 100644 index 00000000000..d1281e2734d --- /dev/null +++ b/bin/runbroker.cmd @@ -0,0 +1,40 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & pause & exit 1 +set "JAVA=%JAVA_HOME%\bin\java.exe" + +set BASE_DIR=%~dp0 +set BASE_DIR=%BASE_DIR:~0,-1% +for %%d in (%BASE_DIR%) do set BASE_DIR=%%~dpd + +set CLASSPATH=.;%BASE_DIR%conf;%CLASSPATH% + +rem =========================================================================================== +rem JVM Configuration +rem =========================================================================================== +set "JAVA_OPT=%JAVA_OPT% -server -Xms8g -Xmx8g -Xmn4g" +set "JAVA_OPT=%JAVA_OPT% -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8 -XX:+DisableExplicitGC" +set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH%mq_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy" +set "JAVA_OPT=%JAVA_OPT% -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m" +set "JAVA_OPT=%JAVA_OPT% -XX:-OmitStackTraceInFastThrow" +set "JAVA_OPT=%JAVA_OPT% -XX:+AlwaysPreTouch" +set "JAVA_OPT=%JAVA_OPT% -XX:MaxDirectMemorySize=15g" +set "JAVA_OPT=%JAVA_OPT% -XX:-UseLargePages -XX:-UseBiasedLocking" +set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib" +set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" + +%JAVA% %JAVA_OPT% %* \ No newline at end of file diff --git a/bin/runserver.cmd b/bin/runserver.cmd index 538f8e16b70..cffd90c70e1 100644 --- a/bin/runserver.cmd +++ b/bin/runserver.cmd @@ -13,3 +13,23 @@ rem distributed under the License is distributed on an "AS IS" BASIS, rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. + + +if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & pause & exit 1 +set "JAVA=%JAVA_HOME%\bin\java.exe" + +set BASE_DIR=%~dp0 +set BASE_DIR=%BASE_DIR:~0,-1% +for %%d in (%BASE_DIR%) do set BASE_DIR=%%~dpd + +set CLASSPATH=.;%BASE_DIR%conf;%CLASSPATH% + +set "JAVA_OPT=%JAVA_OPT% -server -Xms4g -Xmx4g -Xmn2g -XX:PermSize=128m -XX:MaxPermSize=320m" +set "JAVA_OPT=%JAVA_OPT% -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:+DisableExplicitGC -XX:-UseParNewGC" +set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH%rmq_srv_gc.log -XX:+PrintGCDetails" +set "JAVA_OPT=%JAVA_OPT% -XX:-OmitStackTraceInFastThrow" +set "JAVA_OPT=%JAVA_OPT% -XX:-UseLargePages" +set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib" +set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" + +%JAVA% %JAVA_OPT% %* \ No newline at end of file From f9e599b5f8180b6e92c9eeddf826e2cbc2d2bf7b Mon Sep 17 00:00:00 2001 From: Zhanhui Li Date: Wed, 15 Feb 2017 09:44:31 +0800 Subject: [PATCH 4/9] Add more command --- bin/mqadmin.cmd | 18 ++++++++++++++++++ bin/mqbroker.cmd | 19 +++++++++++++++++++ bin/mqfiltersrv.cmd | 19 +++++++++++++++++++ bin/mqnamesrv.cmd | 19 +++++++++++++++++++ bin/{tools.bat => tools.cmd} | 0 5 files changed, 75 insertions(+) create mode 100644 bin/mqadmin.cmd create mode 100644 bin/mqbroker.cmd create mode 100644 bin/mqfiltersrv.cmd create mode 100644 bin/mqnamesrv.cmd rename bin/{tools.bat => tools.cmd} (100%) diff --git a/bin/mqadmin.cmd b/bin/mqadmin.cmd new file mode 100644 index 00000000000..fcfb7cf4e00 --- /dev/null +++ b/bin/mqadmin.cmd @@ -0,0 +1,18 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +if not exist "%ROCKETMQ_HOME%\bin\tools.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 +call %ROCKETMQ_HOME%\bin\tools.cmd org.apache.rocketmq.tools.command.MQAdminStartup %* \ No newline at end of file diff --git a/bin/mqbroker.cmd b/bin/mqbroker.cmd new file mode 100644 index 00000000000..971c49b5537 --- /dev/null +++ b/bin/mqbroker.cmd @@ -0,0 +1,19 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +if not exist "%ROCKETMQ_HOME%\bin\runbroker.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 + +call %ROCKETMQ_HOME%\bin\runbroker.cmd org.apache.rocketmq.broker.BrokerStartup %* \ No newline at end of file diff --git a/bin/mqfiltersrv.cmd b/bin/mqfiltersrv.cmd new file mode 100644 index 00000000000..28ffdc7b592 --- /dev/null +++ b/bin/mqfiltersrv.cmd @@ -0,0 +1,19 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +if not exist "%ROCKETMQ_HOME%\bin\runbroker.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 + +call %ROCKETMQ_HOME%\bin\runserver.cmd org.apache.rocketmq.filtersrv.FiltersrvStartup %* \ No newline at end of file diff --git a/bin/mqnamesrv.cmd b/bin/mqnamesrv.cmd new file mode 100644 index 00000000000..1340d4e955c --- /dev/null +++ b/bin/mqnamesrv.cmd @@ -0,0 +1,19 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +if not exist "%ROCKETMQ_HOME%\bin\runserver.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 + +call %ROCKETMQ_HOME%\bin\runserver.cmd org.apache.rocketmq.namesrv.NamesrvStartup %* \ No newline at end of file diff --git a/bin/tools.bat b/bin/tools.cmd similarity index 100% rename from bin/tools.bat rename to bin/tools.cmd From f1a1c2a4b554134a8c1ea64e1b3345fca6bad84b Mon Sep 17 00:00:00 2001 From: Li Zhanhui Date: Wed, 15 Feb 2017 13:29:08 +0800 Subject: [PATCH 5/9] Fix --- bin/mqadmin.cmd | 6 ++++-- bin/mqbroker.cmd | 6 ++++-- bin/mqfiltersrv.cmd | 6 ++++-- bin/mqnamesrv.cmd | 6 ++++-- bin/runbroker.cmd | 10 +++++++--- bin/runserver.cmd | 10 +++++++--- bin/tools.cmd | 7 +++++-- 7 files changed, 35 insertions(+), 16 deletions(-) diff --git a/bin/mqadmin.cmd b/bin/mqadmin.cmd index fcfb7cf4e00..9fee2d337c5 100644 --- a/bin/mqadmin.cmd +++ b/bin/mqadmin.cmd @@ -14,5 +14,7 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "%ROCKETMQ_HOME%\bin\tools.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 -call %ROCKETMQ_HOME%\bin\tools.cmd org.apache.rocketmq.tools.command.MQAdminStartup %* \ No newline at end of file +if not exist "%ROCKETMQ_HOME%\bin\tools.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & goto end +call "%ROCKETMQ_HOME%\bin\tools.cmd" org.apache.rocketmq.tools.command.MQAdminStartup %* + +:end \ No newline at end of file diff --git a/bin/mqbroker.cmd b/bin/mqbroker.cmd index 971c49b5537..d34a354e8c4 100644 --- a/bin/mqbroker.cmd +++ b/bin/mqbroker.cmd @@ -14,6 +14,8 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "%ROCKETMQ_HOME%\bin\runbroker.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 +if not exist "%ROCKETMQ_HOME%\bin\runbroker.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & goto end -call %ROCKETMQ_HOME%\bin\runbroker.cmd org.apache.rocketmq.broker.BrokerStartup %* \ No newline at end of file +call "%ROCKETMQ_HOME%\bin\runbroker.cmd" org.apache.rocketmq.broker.BrokerStartup %* + +:end \ No newline at end of file diff --git a/bin/mqfiltersrv.cmd b/bin/mqfiltersrv.cmd index 28ffdc7b592..a56657d9386 100644 --- a/bin/mqfiltersrv.cmd +++ b/bin/mqfiltersrv.cmd @@ -14,6 +14,8 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "%ROCKETMQ_HOME%\bin\runbroker.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 +if not exist "%ROCKETMQ_HOME%\bin\runbroker.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & goto end -call %ROCKETMQ_HOME%\bin\runserver.cmd org.apache.rocketmq.filtersrv.FiltersrvStartup %* \ No newline at end of file +call "%ROCKETMQ_HOME%\bin\runserver.cmd" org.apache.rocketmq.filtersrv.FiltersrvStartup %* + +:end \ No newline at end of file diff --git a/bin/mqnamesrv.cmd b/bin/mqnamesrv.cmd index 1340d4e955c..5156378bebb 100644 --- a/bin/mqnamesrv.cmd +++ b/bin/mqnamesrv.cmd @@ -14,6 +14,8 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "%ROCKETMQ_HOME%\bin\runserver.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & pause & exit 1 +if not exist "%ROCKETMQ_HOME%\bin\runserver.cmd" echo Please set the ROCKETMQ_HOME variable in your environment! & goto end -call %ROCKETMQ_HOME%\bin\runserver.cmd org.apache.rocketmq.namesrv.NamesrvStartup %* \ No newline at end of file +call "%ROCKETMQ_HOME%\bin\runserver.cmd" org.apache.rocketmq.namesrv.NamesrvStartup %* + +:end \ No newline at end of file diff --git a/bin/runbroker.cmd b/bin/runbroker.cmd index d1281e2734d..d18d47b8b19 100644 --- a/bin/runbroker.cmd +++ b/bin/runbroker.cmd @@ -14,9 +14,11 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & pause & exit 1 +if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & goto end set "JAVA=%JAVA_HOME%\bin\java.exe" +setlocal + set BASE_DIR=%~dp0 set BASE_DIR=%BASE_DIR:~0,-1% for %%d in (%BASE_DIR%) do set BASE_DIR=%%~dpd @@ -28,7 +30,7 @@ rem JVM Configuration rem =========================================================================================== set "JAVA_OPT=%JAVA_OPT% -server -Xms8g -Xmx8g -Xmn4g" set "JAVA_OPT=%JAVA_OPT% -XX:+UseG1GC -XX:G1HeapRegionSize=16m -XX:G1ReservePercent=25 -XX:InitiatingHeapOccupancyPercent=30 -XX:SoftRefLRUPolicyMSPerMB=0 -XX:SurvivorRatio=8 -XX:+DisableExplicitGC" -set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH%mq_gc_%p.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy" +set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH%\mq_gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCApplicationStoppedTime -XX:+PrintAdaptiveSizePolicy" set "JAVA_OPT=%JAVA_OPT% -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=30m" set "JAVA_OPT=%JAVA_OPT% -XX:-OmitStackTraceInFastThrow" set "JAVA_OPT=%JAVA_OPT% -XX:+AlwaysPreTouch" @@ -37,4 +39,6 @@ set "JAVA_OPT=%JAVA_OPT% -XX:-UseLargePages -XX:-UseBiasedLocking" set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib" set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" -%JAVA% %JAVA_OPT% %* \ No newline at end of file +"%JAVA%" %JAVA_OPT% %* + +:end \ No newline at end of file diff --git a/bin/runserver.cmd b/bin/runserver.cmd index cffd90c70e1..f2f6a2330a3 100644 --- a/bin/runserver.cmd +++ b/bin/runserver.cmd @@ -15,9 +15,11 @@ rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & pause & exit 1 +if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & goto end set "JAVA=%JAVA_HOME%\bin\java.exe" +setlocal + set BASE_DIR=%~dp0 set BASE_DIR=%BASE_DIR:~0,-1% for %%d in (%BASE_DIR%) do set BASE_DIR=%%~dpd @@ -26,10 +28,12 @@ set CLASSPATH=.;%BASE_DIR%conf;%CLASSPATH% set "JAVA_OPT=%JAVA_OPT% -server -Xms4g -Xmx4g -Xmn2g -XX:PermSize=128m -XX:MaxPermSize=320m" set "JAVA_OPT=%JAVA_OPT% -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:+DisableExplicitGC -XX:-UseParNewGC" -set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH%rmq_srv_gc.log -XX:+PrintGCDetails" +set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH%\rmq_srv_gc.log -XX:+PrintGCDetails" set "JAVA_OPT=%JAVA_OPT% -XX:-OmitStackTraceInFastThrow" set "JAVA_OPT=%JAVA_OPT% -XX:-UseLargePages" set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib" set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" -%JAVA% %JAVA_OPT% %* \ No newline at end of file +"%JAVA%" %JAVA_OPT% %* + +:end \ No newline at end of file diff --git a/bin/tools.cmd b/bin/tools.cmd index f1a55b4034c..8b7d1b47eca 100644 --- a/bin/tools.cmd +++ b/bin/tools.cmd @@ -14,10 +14,11 @@ rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. rem See the License for the specific language governing permissions and rem limitations under the License. -if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & pause & exit 1 +if not exist "%JAVA_HOME%\bin\java.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & goto end set "JAVA=%JAVA_HOME%\bin\java.exe" +setlocal set BASE_DIR=%~dp0 set BASE_DIR=%BASE_DIR:~0,-1% for %%d in (%BASE_DIR%) do set BASE_DIR=%%~dpd @@ -30,5 +31,7 @@ rem ============================================================================ set "JAVA_OPT=%JAVA_OPT% -server -Xms1g -Xmx1g -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=128m" set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;%JAVA_HOME%\jre\lib\ext" set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" -%JAVA% %JAVA_OPT% %* +"%JAVA%" %JAVA_OPT% %* + +:end \ No newline at end of file From 38b0476b5232f34297616759bc642fc41c5ba270 Mon Sep 17 00:00:00 2001 From: Li Zhanhui Date: Wed, 15 Feb 2017 13:42:13 +0800 Subject: [PATCH 6/9] Fix --- bin/runserver.cmd | 4 ++-- bin/tools.cmd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/runserver.cmd b/bin/runserver.cmd index f2f6a2330a3..2d561f24ed3 100644 --- a/bin/runserver.cmd +++ b/bin/runserver.cmd @@ -28,11 +28,11 @@ set CLASSPATH=.;%BASE_DIR%conf;%CLASSPATH% set "JAVA_OPT=%JAVA_OPT% -server -Xms4g -Xmx4g -Xmn2g -XX:PermSize=128m -XX:MaxPermSize=320m" set "JAVA_OPT=%JAVA_OPT% -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSInitiatingOccupancyFraction=70 -XX:+CMSParallelRemarkEnabled -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+CMSClassUnloadingEnabled -XX:SurvivorRatio=8 -XX:+DisableExplicitGC -XX:-UseParNewGC" -set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:%HOMEPATH%\rmq_srv_gc.log -XX:+PrintGCDetails" +set "JAVA_OPT=%JAVA_OPT% -verbose:gc -Xloggc:"%HOMEPATH%\rmq_srv_gc.log" -XX:+PrintGCDetails" set "JAVA_OPT=%JAVA_OPT% -XX:-OmitStackTraceInFastThrow" set "JAVA_OPT=%JAVA_OPT% -XX:-UseLargePages" set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib" -set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" +set "JAVA_OPT=%JAVA_OPT% -cp "%CLASSPATH%"" "%JAVA%" %JAVA_OPT% %* diff --git a/bin/tools.cmd b/bin/tools.cmd index 8b7d1b47eca..daf60864e64 100644 --- a/bin/tools.cmd +++ b/bin/tools.cmd @@ -29,8 +29,8 @@ rem ============================================================================ rem JVM Configuration rem =========================================================================================== set "JAVA_OPT=%JAVA_OPT% -server -Xms1g -Xmx1g -Xmn256m -XX:PermSize=128m -XX:MaxPermSize=128m" -set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs=%BASE_DIR%lib;%JAVA_HOME%\jre\lib\ext" -set "JAVA_OPT=%JAVA_OPT% -cp %CLASSPATH%" +set "JAVA_OPT=%JAVA_OPT% -Djava.ext.dirs="%BASE_DIR%\lib";"%JAVA_HOME%\jre\lib\ext"" +set "JAVA_OPT=%JAVA_OPT% -cp "%CLASSPATH%"" "%JAVA%" %JAVA_OPT% %* From 08c3ca24df8cf6014376835cb3937c93bb78e149 Mon Sep 17 00:00:00 2001 From: Li Zhanhui Date: Wed, 15 Feb 2017 17:04:03 +0800 Subject: [PATCH 7/9] Add script: mqshutdown.cmd --- bin/mqshutdown.cmd | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 bin/mqshutdown.cmd diff --git a/bin/mqshutdown.cmd b/bin/mqshutdown.cmd new file mode 100644 index 00000000000..e559688512d --- /dev/null +++ b/bin/mqshutdown.cmd @@ -0,0 +1,35 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +if not exist "%JAVA_HOME%\bin\jps.exe" echo Please set the JAVA_HOME variable in your environment, We need java(x64)! & goto end + +setlocal + +set "PATH=%JAVA_HOME%\bin;%PATH%" + +if /I "%1" == "broker" ( + echo killing broker + for /f "tokens=1" %%i in ('jps -m ^| find "BrokerStartup"') do ( taskkill /F /PID %%i ) + echo Done! +) else if /I "%1" == "namesrv" ( + echo killing name server + + for /f "tokens=1" %%i in ('jps -m ^| find "NamesrvStartup"') do ( taskkill /F /PID %%i ) + + echo Done! +) else ( + echo Unknown role to kill, please specify broker or namesrv +) \ No newline at end of file From ac0561189cd36f1d6e0bbc48e39b8b276595d071 Mon Sep 17 00:00:00 2001 From: Li Zhanhui Date: Wed, 15 Feb 2017 17:04:56 +0800 Subject: [PATCH 8/9] Add end tag. --- bin/mqshutdown.cmd | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/mqshutdown.cmd b/bin/mqshutdown.cmd index e559688512d..47317d8c785 100644 --- a/bin/mqshutdown.cmd +++ b/bin/mqshutdown.cmd @@ -32,4 +32,6 @@ if /I "%1" == "broker" ( echo Done! ) else ( echo Unknown role to kill, please specify broker or namesrv -) \ No newline at end of file +) + +:end \ No newline at end of file From ba4c5960634027a1732889df0de3448930a315ac Mon Sep 17 00:00:00 2001 From: Li Zhanhui Date: Wed, 15 Feb 2017 17:14:04 +0800 Subject: [PATCH 9/9] Add script: play --- bin/play.cmd | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 bin/play.cmd diff --git a/bin/play.cmd b/bin/play.cmd new file mode 100644 index 00000000000..545864af786 --- /dev/null +++ b/bin/play.cmd @@ -0,0 +1,19 @@ +@echo off +rem Licensed to the Apache Software Foundation (ASF) under one or more +rem contributor license agreements. See the NOTICE file distributed with +rem this work for additional information regarding copyright ownership. +rem The ASF licenses this file to You under the Apache License, Version 2.0 +rem (the "License"); you may not use this file except in compliance with +rem the License. You may obtain a copy of the License at +rem +rem http://www.apache.org/licenses/LICENSE-2.0 +rem +rem Unless required by applicable law or agreed to in writing, software +rem distributed under the License is distributed on an "AS IS" BASIS, +rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +rem See the License for the specific language governing permissions and +rem limitations under the License. + +START /B mqnamesrv > ns.log +START /B mqbroker -n localhost:9876 > bk.log +echo "Start Name Server and Broker Successfully." \ No newline at end of file