最近在研究唯品汇的saturn,发现根据官方文档启动console时,老是卡在spring启动画面,如下:

官网给的启动脚本:

java -DSATURN_CONSOLE_DB_URL=jdbc:mysql://localhost:3306/saturn -DSATURN_CONSOLE_DB_USERNAME=root -DSATURN_CONSOLE_DB_PASSWORD=root -jar saturn-console-3.5.1-exec.jar

 

 

到这里要么不动了,要么就结束,网上也搜索了也没找到具体原因。后来把原码下载来打开看,发现里面的快速启动有个脚本。参考那个写法成功启动。

首先说明下环境:win11, mysql5.740, zk3.4.6

 

 

 原脚本内容:使用h2数据库和内嵌的zk.

start "saturn console" java -Dfile.encoding=UTF-8 -Dsaturn.embeddedZk=true -Dsaturn.embeddedDb=true -Dspring.h2.console.enabled=true -Dsaturn.stdout=true -jar saturn-console/target/saturn-console-3.5.1-exec.jar

 修改后的:使用mysql和自己安装的zk

start "saturn console" java -Dfile.encoding=UTF-8 -Dsaturn.embeddedZk=false -Dsaturn.embeddedDb=false -Dspring.h2.console.enabled=true -Dsaturn.stdout=true -DSATURN_CONSOLE_DB_URL=jdbc:mysql://localhost:3306/saturn -DSATURN_CONSOLE_DB_USERNAME=root -DSATURN_CONSOLE_DB_PASSWORD=root -jar saturn-console/target/saturn-console-3.5.1-exec.jar




使用修改后的脚本启动成功:注意jar包的路径

 

 

 

 说明:start 是bat命令打开新窗口,后面的 saturn console 是窗口名称,用“”引起来,从java开始是执行的命令。

最后附上一张启动成功后的讯问页面:

 

posted on 2023-03-10 22:26  skyxia  阅读(92)  评论(0编辑  收藏  举报