中间件自定义可执行启动脚本

Redis启动脚本

D:
cd "D:\Software\Redis\redis3.2.1"
start redis-server.exe redis.windows.conf

RocketMQ启动脚本

D:
cd "D:\Software\RocketMQ\rocketmq-4.5.2\bin"
echo "RocketMQ启动ing"
start mqnamesrv.cmd
echo "RocketMQ已启动"
echo "Broker程序启动ing"
start mqbroker.cmd -n 127.0.0.1:9876 autoCreateTopicEnable=true
echo "Broker程序已启动"

Solr启动脚本

D:
cd "D:\Software\Solr\solr-7.7.2\bin"
solr start

Nginx启动脚本


@echo off
rem 提供Windows下nginx的启动,重启,关闭功能
echo ==================begin========================
cls 
::ngxin 所在的盘符
set NGINX_PATH=D:

::nginx 所在目录

set NGINX_DIR=D:\Software\Nginx\nginx-1.15.11\

color 0a 

TITLE Nginx Controller

CLS 

echo. 

echo. ** Nginx Controller Program  *** 

echo. *** create %DATE% %TIME%  *** 

echo. 

:MENU 

 
echo. ***** Nginx List Manager ****** 

::tasklist|findstr /i "nginx.exe"

tasklist /fi "imagename eq nginx.exe"


echo. 

    if ERRORLEVEL 1 (

        echo nginx.exe not exist

    ) else (

        echo nginx.exe exist

    )

echo. 

::*************************************************************************************************************

echo. 

	echo.  [1] Start Nginx  

	echo.  [2] Stop Nginx  

	echo.  [3] Restart Nginx 

	echo.  [4] Refresh Console  

	echo.  [5] Reload Nginx Config File

	echo.  [6] Check Nginx Config File

	echo.  [7] Show Nginx version

	echo.  [0] Exit

echo. 

 

echo.Please enter the selected serial number:

set /p ID=

	IF "%id%"=="1" GOTO start 

	IF "%id%"=="2" GOTO stop 

	IF "%id%"=="3" GOTO restart 

	IF "%id%"=="4" GOTO MENU

	IF "%id%"=="5" GOTO reloadConf 

	IF "%id%"=="6" GOTO checkConf 

	IF "%id%"=="7" GOTO showVersion 

	IF "%id%"=="0" EXIT

PAUSE 

::*************************************************************************************************************

::启动

:start 

	call :startNginx

	GOTO MENU

::停止

:stop 

	call :shutdownNginx

	GOTO MENU

::重启

:restart 

	call :shutdownNginx

	call :startNginx

	GOTO MENU

::检查测试配置文件

:checkConf 

	call :checkConfNginx

	GOTO MENU

::重新加载Nginx配置文件

:reloadConf 

    call :checkConfNginx

	call :reloadConfNginx

	GOTO MENU

::显示nginx版本

:showVersion 

    call :showVersionNginx

	GOTO MENU	
	

::*************************************************************************************

::底层

::*************************************************************************************

:shutdownNginx

	echo. 

	echo.Close Nginx...... 

	taskkill /F /IM nginx.exe > nul

	echo.OK,Close all nginx processes

	goto :eof


:startNginx

	echo. 

	echo.Start Nginx...... 

	IF NOT EXIST "%NGINX_DIR%nginx.exe" (

        echo "%NGINX_DIR%nginx.exe" not exist

        goto :eof

     )

	%NGINX_PATH% 

	cd "%NGINX_DIR%" 

	IF EXIST "%NGINX_DIR%nginx.exe" (

		echo "start '' nginx.exe"

		start "" nginx.exe

	)

	echo.OK,Nginx processes is running

	goto :eof


:checkConfNginx

	echo. 

	echo.Check the test nginx configuration file...... 

	IF NOT EXIST "%NGINX_DIR%nginx.exe" (

        echo "%NGINX_DIR%nginx.exe" not exist

        goto :eof

     )


	%NGINX_PATH% 

	cd "%NGINX_DIR%" 

	nginx -t -c conf/nginx.conf

 
	goto :eof

	

::重新加载 nginx 配置文件

:reloadConfNginx

	echo. 

	echo.Reload the nginx configuration file...... 

	IF NOT EXIST "%NGINX_DIR%nginx.exe" (

        echo "%NGINX_DIR%nginx.exe" not exist

        goto :eof

     )

 
	%NGINX_PATH% 

	cd "%NGINX_DIR%" 

	nginx -s reload

	goto :eof

	

::显示nginx版本

:showVersionNginx

	echo. 

	%NGINX_PATH% 

	cd "%NGINX_DIR%" 

	nginx -V

 	goto :eof


你可能感兴趣的:(Tools,Redis,Nginx,中间件,nginx,java)