@ECHO OFF
CD /D %~dp0
SET NAME=7000
TITLE %NAME%
@ECHO ON
NET STOP redis_server_%NAME%
redis-server.exe --service-uninstall --service-name redis_server_%NAME%
SC DELETE redis_server_%NAME%
redis-server.exe --service-install "%CD%\node.conf" --service-name redis_server_%NAME%
SC DESCRIPTION redis_server_%NAME% redis_server_%NAME%
NET START redis_server_%NAME%
@REM NET STOP redis_server_%NAME%
@REM SC DELETE redis_server_%NAME%
@REM redis-server.exe --service-uninstall --service-name redis_server_%NAME%
EXIT
stop.bat
@ECHO OFF
SET NAME=7000
TITLE %NAME%
CD /D %~dp0
@ECHO ON
redis-server.exe --service-uninstall --service-name redis_server_%NAME%
SC DELETE redis_server_%NAME%
NET STOP redis_server_%NAME%
EXIT
@ECHO OFF
CD /D %~dp0
@REM gem uninstall redis
@REM choice /t 10 /d y /n >nul
@REM gem install redis --version 3.2.0
@REM choice /t 10 /d y /n >nul
SET HOST=127.0.0.1
ruby redis-trib.rb create --replicas 1 %HOST%:7000 %HOST%:7001 %HOST%:7002 %HOST%:7003 %HOST%:7004 %HOST%:7005
@ECHO ON
cluster-start.bat
@ECHO OFF
CD /D %~dp0
SET ROOT=%CD%
@ECHO ON
SET NAME=7000
START %ROOT%\%NAME%\start.bat
SET NAME=7001
START %ROOT%\%NAME%\start.bat
SET NAME=7002
START %ROOT%\%NAME%\start.bat
CD /D %ROOT%
SET NAME=7003
START %ROOT%\%NAME%\start.bat
CD /D %ROOT%
SET NAME=7004
START %ROOT%\%NAME%\start.bat
SET NAME=7005
START %ROOT%\%NAME%\start.bat
@ECHO &PAUSE
cluster-stop.bat
@ECHO OFF
SET ROOT=%~dp0
@ECHO ON
SET NAME=7000
@ECHO "%ROOT%%NAME%\stop.bat"
%COMSPEC% /C START %ROOT%%NAME%\stop.bat
SET NAME=7001
@ECHO "%ROOT%%NAME%\stop.bat"
%COMSPEC% /C START %ROOT%%NAME%\stop.bat
SET NAME=7002
@ECHO "%ROOT%%NAME%\stop.bat"
%COMSPEC% /C START %ROOT%%NAME%\stop.bat
SET NAME=7003
@ECHO "%ROOT%%NAME%\stop.bat"
%COMSPEC% /C START %ROOT%%NAME%\stop.bat
SET NAME=7004
@ECHO "%ROOT%%NAME%\stop.bat"
%COMSPEC% /C START %ROOT%%NAME%\stop.bat
SET NAME=7005
@ECHO "%ROOT%%NAME%\stop.bat"
%COMSPEC% /C START %ROOT%%NAME%\stop.bat
CHOICE /T 5 /D Y /N>NUL
DEL /S /Q dump.rdb
DEL /S /Q appendonly.aof
DEL /S /Q cluster-nodes.conf
@ECHO &PAUSE