k8s环境安装HZero数据库初始化失败

执行sh database-init.sh 后,抛出异常,无法初始化数据库
HZero版本 1.4
数据库:MySQL5.7.26

2021-01-17 22:14:19.225 INFO 74548 — [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8099 (http) with context path ‘’
2021-01-17 22:14:19.229 INFO 74548 — [ main] o.hzero.installer.InstallerApplication : Started InstallerApplication in 6.778 seconds (JVM running for 7.331)
2021-01-17 22:14:19.276 INFO 74548 — [ main] org.hzero.installer.utils.XmlUtils : service-mapping.xml <<< File parsing successful
java.net.UnknownHostException: 10-120-15-55: 10-120-15-55: 系统错误
at java.net.InetAddress.getLocalHost(InetAddress.java:1506)
at org.hzero.installer.InstallerApplication.main(InstallerApplication.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:51)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52)
Caused by: java.net.UnknownHostException: 10-120-15-55: 系统错误
at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324)
at java.net.InetAddress.getLocalHost(InetAddress.java:1501)
… 9 more

其实这个日志也不影响功能使用,可以访问 http://服务地址:8099(如果没有修改端口,默认8099)打开管理界面。

这个问题应该是容器中 jdk 使用 InetAddress 获取当前的 ip 时会出现错误。database-init.sh 脚本不应该在 容器中运行,这个脚本运行的程序主要是为了初始化种子数据,可以在本地或者任何linux服务器上直接运行脚本,完成安装后退出程序即可。