为了一键把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%ElasticsearchServerelasticsearch-6.3.0inelasticsearch.bat" ping localhost -n 30 @echo =============数据仓库启动==head启动============= cd "%startDir%ElasticsearchServerelasticsearch-6.3.0head" set headPath=%cd% echo %headPath% start "数据仓库管理站点启动" /D %headPath% cmd /c grunt server ping localhost -n 5 @echo =============数据仓库启动==sql插件启动============= @echo cd "%startDir%ElasticsearchServeres-sql-site-standalonesite-server" @echo node node-server.js @echo pause cd "%startDir%ElasticsearchServeres-sql-site-standalonesite-server" set plusPath=%cd% start "数据仓库插件启动" /D %plusPath% cmd /c node node-server.js ping localhost -n 5 @echo =============1.数据仓库启动==结束============= @echo =============2.数据库MySQL启动===开始=========... cd "%startDir%CBoardmysqlin" start "BI应用服务后台数据库" "startup.bat" ping localhost -n 10 @echo =============2.数据库MySQL启动===结束=========... @echo =============3.应用服务器启动===开始=========... cd "%startDir%CBoardapache-tomcat-7.0.85in" start "BI应用服务器" "startup.bat" @echo =============3.应用服务器启动===结束=========...