From b38de8ab019d5650c09889c5a5aee00ffec63a49 Mon Sep 17 00:00:00 2001 From: Gabriel Zhou Date: Sun, 21 Jun 2020 11:34:48 +0800 Subject: [PATCH] [TUBEMQ-226] Add Windows startup scripts (#141) Co-authored-by: Gabriel Zhou --- bin/broker.cmd | 28 ++++++++++++++++++++++++++++ bin/env.cmd | 31 +++++++++++++++++++++++++++++++ bin/master.cmd | 28 ++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 bin/broker.cmd create mode 100644 bin/env.cmd create mode 100644 bin/master.cmd diff --git a/bin/broker.cmd b/bin/broker.cmd new file mode 100644 index 00000000000..b53dbbcbd6e --- /dev/null +++ b/bin/broker.cmd @@ -0,0 +1,28 @@ +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. + +REM Windows Startup Script for Broker Node +REM please do not change any command or variable in this script, check out +REM env.cmd for details. + +setlocal +call "%~dp0env.cmd" + +set BROKERMAIN=org.apache.tubemq.server.tools.BrokerStartup +set BROKERCFG=%~dp0../conf/broker.ini + +echo on +call %JAVA% %BROKER_JVM_OPTS% %GENERIC_ARGS% "%BROKERMAIN%" -f "%BROKERCFG%" +endlocal \ No newline at end of file diff --git a/bin/env.cmd b/bin/env.cmd new file mode 100644 index 00000000000..248a76280fe --- /dev/null +++ b/bin/env.cmd @@ -0,0 +1,31 @@ +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. + +REM Windows Startup Script about Environment Settings +REM Java runtime evironment could be specified here. + +set BASE_DIR=%~dp0.. +set CLASSPATH=%BASE_DIR%\lib\*;%BASE_DIR%\tubemq-server\target\*;%CLASSPATH% +set GENERIC_ARGS="-Dtubemq.home=%BASE_DIR%" -cp "%CLASSPATH%" "-Dlog4j.configuration=file:%BASE_DIR%\conf\master.log4j.properties" + +REM If there's no system-wide JAVA_HOME or there's need to run on specific Java, +REM please uncomment the following JAVA_HOME line, and specify the java home path. +REM set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_241 + +set JAVA="%JAVA_HOME%\bin\java" + +REM One may add extra Java runtime flags in addition to each role: Master or Broker +set MASTER_JVM_OPTS=-Xmx1g -Xms256m -server +set BROKER_JVM_OPTS=-Xmx1g -Xms512g -server \ No newline at end of file diff --git a/bin/master.cmd b/bin/master.cmd new file mode 100644 index 00000000000..b1446b0fee5 --- /dev/null +++ b/bin/master.cmd @@ -0,0 +1,28 @@ +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. + +REM Windows Startup Script for Master Node +REM please do not change any command or variable in this script, check out +REM env.cmd for details. + +setlocal +call "%~dp0env.cmd" + +set MASTERMAIN=org.apache.tubemq.server.tools.MasterStartup +set MASTERCFG=%~dp0..\conf\master.ini + +echo on +call %JAVA% %MASTER_JVM_OPTS% %GENERIC_ARGS% "%MASTERMAIN%" -f "%MASTERCFG%" +endlocal \ No newline at end of file