为了一键把es、head插件、es-sql插件、mysql、cboard都启动起来。不用每次来回点bat文件。新做了一个bat记录如下。
其中几个知识点:
1.bat中用start模拟多线程,启动多个bat文件。
2.在start中如何启动grunt和node。
3.每个线程启动的时间间隔用ping来实现。
@echo off title BI应用服务器 cd /d %~dp0 set startDir=%cd% @echo =============1.数据仓库启动==开始============= start "数据仓库启动" "%startDir%\Elasticsearch\Server\elasticsearch-6.3.0\bin\elasticsearch.bat" ping localhost -n 30 @echo =============数据仓库启动==head启动============= cd "%startDir%\Elasticsearch\Server\elasticsearch-6.3.0\head" set headPath=%cd% echo %headPath% start "数据仓库管理站点启动" /D %headPath% cmd /c grunt server ping localhost -n 5 @echo =============数据仓库启动==sql插件启动============= @echo cd "%startDir%\Elasticsearch\Server\es-sql-site-standalone\site-server" @echo node node-server.js @echo pause cd "%startDir%\Elasticsearch\Server\es-sql-site-standalone\site-server" set plusPath=%cd% start "数据仓库插件启动" /D %plusPath% cmd /c node node-server.js ping localhost -n 5 @echo =============1.数据仓库启动==结束============= @echo =============2.数据库MySQL启动===开始=========... cd "%startDir%\CBoard\mysql\bin" start "BI应用服务后台数据库" "startup.bat" ping localhost -n 10 @echo =============2.数据库MySQL启动===结束=========... @echo =============3.应用服务器启动===开始=========... cd "%startDir%\CBoard\apache-tomcat-7.0.85\bin" start "BI应用服务器" "startup.bat" @echo =============3.应用服务器启动===结束=========...
原文地址:https://www.cnblogs.com/Bruce_H21/p/9366193.html
时间: 2024-10-10 14:51:25