本文基于 Pinpoint 2.1.0 版本
pinpoint-flink-job-2.1.0.jar 编译和导入
官方的相关文档见 https://github.com/pinpoint-apm/pinpoint-docker#flink-configuration-optional
首先我们需要更改源码 pinpoint-flink-job 对应的代码,原因是这个里面配置的 ZK是写死的。我们需要更改。
./flink/src/main/resources/profiles/local/hbase.properties
配置我们线上的 Hbase 使用的ZK 地址
hbase.client.host=192.168.80.129
hbase.client.port=2181
./flink/src/main/resources/profiles/local/pinpoint-flink.properties
配置我们线上的 ZK 地址
Flink.cluster.enable=true # 这个需要配置未 true 否则会导入失败
flink.StreamExecutionEnvironment=server
flink.cluster.zookeeper.address=192.168.80.129
然后进行编译,编译完之后,在 target 找到对应的包下载下来。
然后打开 pinpoint-flink-jobmanager
所在的 8081 端口
在Submit 的地方上传我们上面编译的包 ,然后填入我们下面的信息加到 entry class
com.navercorp.pinpoint.flink.StatStreamingVer2Job
提交成功
提交失败
解决导入失败的问题 issues: https://github.com/pinpoint-apm/pinpoint/issues/4178
org.apache.flink.client.program.ProgramInvocationException: The main method caused an error.
at org.apache.flink.client.program.PackagedProgram.callMainMethod(PackagedProgram.java:545)
at org.apache.flink.client.program.PackagedProgram.invokeInteractiveModeForExecution(PackagedProgram.java:419)
at org.apache.flink.client.program.OptimizerPlanEnvironment.getOptimizedPlan(OptimizerPlanEnvironment.java:80)
at org.apache.flink.client.program.ClusterClient.getOptimizedPlan(ClusterClient.java:318)
at org.apache.flink.runtime.webmonitor.handlers.JarActionHandler.getJobGraphAndClassLoader(JarActionHandler.java:72)
at org.apache.flink.runtime.webmonitor.handlers.JarRunHandler.handleJsonRequest(JarRunHandler.java:61)
at org.apache.flink.runtime.webmonitor.handlers.AbstractJsonRequestHandler.handleRequest(AbstractJsonRequestHandler.java:41)
at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandler.respondAsLeader(RuntimeMonitorHandler.java:109)
at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:97)
at org.apache.flink.runtime.webmonitor.RuntimeMonitorHandlerBase.channelRead0(RuntimeMonitorHandlerBase.java:44)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
at io.netty.handler.codec.http.router.Handler.routed(Handler.java:62)
at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:57)
at io.netty.handler.codec.http.router.DualAbstractHandler.channelRead0(DualAbstractHandler.java:20)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRea