polardbx-sql
polardbx-sql copied to clipboard
startup.sh -I error "initialize gms failed ..." not written to logfile
运行 startup.sh -I 初始化GMS时,如果出现错误,没有生成日志文件tddl.log
polardbx-server/src/main/java/com/alibaba/polardbx/server/TddlLauncher.java
67 try {
68 initUserAccount(config);
69 initGms(config);
70 initPolarxRootUser(config);
71 System.err.println("Initialize polardbx success");
72 System.exit(0);
73 } catch (SQLException e) {
74 logger.error("initialize gms failed due to: " + e);
75 System.exit(1);
76 }
根据conf/logbak.xml中的配置,此logger会走到asyncROOT appender,由于程序立即退出,日志会来不及写入日志文件(tddl.log)
有两种改法都可以:1)简单的在exit之前增加 e.printStackTrace(); 2)在exit之前Thread.sleep(3000) (我自己的环境sleep 1秒就可以)
Thank you for your advice, can u create the pull request for this? @luyaning