Flink-exporter部署文档

一、Flink配置

1.拷贝 opt目录下的flink-metrics-prometheus-1.7.2.jar 到lib目录

2.编辑conf/flink-conf.yml

metrics.reporter.promgateway.class: org.apache.flink.metrics.prometheus.PrometheusPushGatewayReporter
metrics.reporter.promgateway.host: 192.168.XX.XX
metrics.reporter.promgateway.port: 19091
metrics.reporter.promgateway.jobName: myJob
metrics.reporter.promgateway.randomJobNameSuffix: true
metrics.reporter.promgateway.deleteOnShutdown: false

3.重启Flink集群:bin/stop-cluster.sh bin/start-cluster.sh

二、PushGateWay部署

下载地址:
https://github.com/prometheus/pushgateway/releases/download/v1.4.2/pushgateway-1.4.2.linux-amd64.tar.gz
可以用 ./pushgateway -h 查看运行选项,./pushgateway 运行 pushgateway, 如果看到类似输出,表示启动成功。

INFO[0000] Starting pushgateway (version=0.4.0, branch=master, revision=6ceb4a19fa85ac2d6c2d386c144566fb1ede1f6c)  source=main.go:57
INFO[0000] Build context (go=go1.8.3, user=root@87741d1b66a9, date=20170609-12:26:14)  source=main.go:58
INFO[0000] Listening on :19091.                           
source=main.go:102

我这里改了默认端口:
nohup ./pushgateway --web.listen-address=’:19091’ &

最后访问192.128.XX.XX:19091,如果有数据则部署成功!

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐