Kafka使用jmxtrans+influxdb+grafana监控JMX指标(3)

wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-6.0.2-1.x86_64.rpm
--2019-04-10 04:53:15--  https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-6.0.2-1.x86_64.rpm
Resolving s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)... 52.218.144.92
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.144.92|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 56002012 (53M) [application/x-RedHat-package-manager]
Saving to: ‘grafana-6.0.2-1.x86_64.rpm’

100%[================================================================================================================================================================================>] 56,002,012 177KB/s in 2m 52s

2019-04-10 04:56:08 (318 KB/s) - ‘grafana-6.0.2-1.x86_64.rpm’ saved [56002012/56002012]

安装rpm包

rpm -ivh grafana-6.0.2-1.x86_64.rpm
warning: grafana-6.0.2-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
error: Failed dependencies:
    fontconfig is needed by grafana-6.0.2-1.x86_64
    urw-fonts is needed by grafana-6.0.2-1.x86_64

缺少依赖,下载依赖

yum install --downloadonly --downloaddir=./ fontconfig

yum localinstall fontconfig-2.13.0-4.3.el7.x86_64.rpm

yum install --downloadonly --downloaddir=./ urw-fonts

yum localinstall urw-fonts-2.4-16.el7.noarch.rpm

rpm -ivh grafana-6.0.2-1.x86_64.rpm
warning: grafana-6.0.2-1.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 24098cb6: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
  1:grafana-6.0.2-1                  ################################# [100%]
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server.service
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server.service
POSTTRANS: Running script

启动Grafana

service grafana-server start
Starting grafana-server (via systemctl):                  [  OK  ]

打开浏览器

:3000

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  先输入默认用户名密码admin/admin

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  设置新密码

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  点击Add data source

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  选择InfluxDB

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  输入连接信息后点击Save & Test

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  通过后点击Back返回

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  左侧 + 可以创建或引入仪表盘

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

  类似于数据库SQL语句,查询相应的指标

Kafka使用jmxtrans+influxdb+grafana监控JMX指标

计算平均每秒数值可以使用如上语法,用当前值减1分钟之前的值再除以60

具体展示效果就看各位的审美能力,这里就不贴出来了。至此,Kafka的JMX指标监控就完成了。

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6c9d2b24e66e4d4e601f49a516ffa762.html