polardbx-sql icon indicating copy to clipboard operation
polardbx-sql copied to clipboard

startup.sh -I error "initialize gms failed ..." not written to logfile

Open luyaning opened this issue 4 years ago • 1 comments

运行 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秒就可以)

luyaning avatar Oct 28 '21 16:10 luyaning

Thank you for your advice, can u create the pull request for this? @luyaning

hustfxj avatar Oct 29 '21 07:10 hustfxj