- (328条消息) prometheus+grafana 监控hadoop、yarn_等等留一手的博客-CSDN博客_grafana hadoop
- 实操文件如下:
- hive_metastore.yaml
- startDelaySeconds: 0
- hostPort: localhost:9922 #1234为想设置的jmx端口(可设置为未被占用的端口)
- ssl: false
- lowercaseOutputName: false
- lowercaseOutputLabelNames: false
- hive_hiveserver2.yaml
- startDelaySeconds: 0
- hostPort: localhost:9822 #1235为想设置的jmx端口(可设置为未被占用的端口)
- ssl: false
- lowercaseOutputName: false
- lowercaseOutputLabelNames: false
- ${HIVE_HOME} /conf/hive-env.sh 添加如下代码
- vim /usr/hdp/3.1.4.0-315/hive/conf/hive-env.sh (这个配置只能配置到ambari的hive-env上,才会生效)
- if [ “$SERVICE” = “hiveserver2” ] ; then
- HADOOP_CLIENT_OPTS=”$HADOOP_CLIENT_OPTS -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=1240 -javaagent:/opt/module4/promethus_grafana/prometheus_jmx_export_0.9/jmx_prometheus_javaagent-0.9.jar=9822:/opt/module4/promethus_grafana/prometheus_jmx_export_0.9/hive_hiveserver2.yaml”
- fi
- if [ “$SERVICE” = “metastore” ] ; then
- HADOOP_CLIENT_OPTS=”$HADOOP_CLIENT_OPTS -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.port=1241 -javaagent:/opt/module4/promethus_grafana/prometheus_jmx_export_0.9/jmx_prometheus_javaagent-0.9.jar=9922:/opt/module4/promethus_grafana/prometheus_jmx_export_0.9/hive_metastore.yaml”
- fi
- vim prometheus.yml
- 注意hive-metastore和hiveserver2是安装在data-02-pro上的
- 重启promethues
- lsof -i :9090 (查看占用9090端口号的进程号)
- kill -9 xxxx 杀掉prometheus的进程
- 在prometheus的bin目录下重新运行nohup ./prometheus –config.file=prometheus.yml > ./prometheus.log 2>&1 &