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

2 篇文章 0 订阅
1 篇文章 0 订阅

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


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值