dinky
dinky copied to clipboard
[Bug] [集群配置] k8s Application 模式无法查看日志
Search before asking
- [X] I had searched in the issues and found no similar issues.
What happened
k8s Application 模式 配置文件路径中有日志相关配置文件,但创建的flink集群中只生成了flink-conf.yaml,没有日志配置文件,导致无法查看Flink日志
Dinky的配置文件路径:
Flink的配置文件路径:
What you expected to happen
k8s Application 模式创建的Flink集群时,与flink-conf.yaml一样,获取到指定配置文件路径并生成日志配置文件
How to reproduce
- 集群配置管理中配置 Flink On Kubernetes 的“配置文件路径”,路径中包含log4j、logback等日志配置文件
- 提交 k8s Application 任务,生成的 Flink 集群中的 /opt/flink/conf 路径下无日志配置文件
- 无法查看 JobManager、TaskManager 日志
Anything else
No response
Version
dev
Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
配置文件那边,dinky是只读去flink-conf.yaml,其他log4j日志这些文件是无法获取的。如果你想要完整的日志,请在当前镜像的conf文件目录添加完整的日志配置文件
基础镜像用的是flink官方的,镜像的conf文件目录也有日志配置文件,flink-conf.yaml是以configmap的方式映射的,把conf目录替换掉了就没有了,是否有方式可以单独指定日志配置文件目录?
Contributor
我这里也是官方镜像,但是有日志文件;image apache/flink:1.14.5-scala_2.12
如果你那边镜像里面确实没有日志配置的话,你需要自定义镜像并包含此日志文件等
你这里的日志配置文件也是configmap吗,dinky里集群配置的配置文件路径里有包含日志配置文件吗 我的在镜像里是有日志配置文件的,但提交Application之后生成的configmap里只有flink-conf.yaml,覆盖掉了原来的conf文件目录,原有的日志配置文件也没了
dinky集群配置的配置文件路径也加下日志配置文件试试
dinky集群配置的配置文件路径里是有日志配置文件的
那么还可能会有什么其他原因呢
看到 YarnGateway 的 initConfig() 方法里设置日志配置文件: YarnLogConfigUtil.setLogConfigFileInConfig(configuration, config.getClusterConfig().getFlinkConfigPath());
而 KubernetesGateway 里没有,k8s是否也需要类似的配置吗
看到 YarnGateway 的 initConfig() 方法里设置日志配置文件: YarnLogConfigUtil.setLogConfigFileInConfig(configuration, config.getClusterConfig().getFlinkConfigPath());
而 KubernetesGateway 里没有,k8s是否也需要类似的配置吗
目前需要再跟踪下Flink源码了
问题目前已经发现了,就是k8s中的configmap没有log4j相关文件配置
问题目前已经发现了,就是k8s中的configmap没有log4j相关文件配置
我看了下源码,这个问题其实在配置里加上kubernetes.flink.conf.dir,值为flinkconfig地址就可以正常挂载log4j文件了,但是这样做了之后会导致jobmanger启动报错,不知道原因
这边我已经在修复此问题了,下个版本就能正常使用