我是学习者,需要帮助 .
我有一个实现Flink MetricsReporter interface的Java maven项目,作为我的自定义记者发送指标 .
在我当地的Flink,我能够:
-
在本地flink-conf.yaml文件中添加Flink JMX reporter config .
-
从端口8789开始flink
-
使用JConsole(JMX控制台)连接到远程localhost:8789
-
重新启动flink,请参阅JConsole Beans下的flink指标 .
在这个工作流程有效的概念证明之后,我想要做的是:
-
我写了一个实现metrics interface的自定义记者,我将记者建成了一个 jar ,里面有所有必要的依赖 .
-
我按照The important paragraph of the Reporter documentation的建议将jar移动到flink
lib/
文件夹下
我的 jar 名为 x-y-reporter-1.0-SNAPSHOT.jar
pom
<groupId>a.b.c</groupId>
<artifactId>x-y-reporter</artifactId>
<version>1.0-SNAPSHOT</version>
我将下面的配置更新为flink-conf.yaml
metrics.reporters: x-y-reporter
metrics.reporter.x-y-reporter.class: com.b.c.xyreporter.XYReporter
metrics.reporter.x-y-reporter.class.host: localhost
metrics.reporter.x-y-reporter.port: 8789
题:
-
我想在flink-conf.yaml中将JMX配置替换为我自己的记者配置 . 上面的配置不起作用 . 我该怎么办?每个参数意味着什么?
-
我希望看到JMX控制台中的指标,如JMX-reporter . 是否也通过端口号配置?
非常感谢你 .
1 回答
使用问题中的配置重新启动flink后检查flink日志 . 事实证明,我的自定义类中存在错误 . 修复错误后,通过连接到JConsole中的LOCAL apache-flink进程,我可以看到MBean列表下的类 . 我不需要连接到远程或localhost .