jmx

How to get a MBean binding class instance

丶灬走出姿态 提交于 2019-12-01 07:28:41
问题 I am trying to get the instance of a service class bound in jboss-service.xml using MBean. JBoss-Service.xml has defined a BasicThreadPool which we want to use it in our code. This is what it is in JBOSS-Service.xml . <mbean code="org.jboss.util.threadpool.BasicThreadPool" name="jboss.system:service=ThreadPool"> <attribute name="Name">JBoss System Threads</attribute> <attribute name="ThreadGroupName">System Threads</attribute> <attribute name="KeepAliveTime">60000</attribute> <attribute name=

Query for system (not JVM) uptime in Java [duplicate]

隐身守侯 提交于 2019-12-01 06:35:36
This question already has an answer here: Get system uptime in Java 5 answers Is there a OS-neutral method of querying for system (not JVM - I am aware of RuntimeMXBean.getUptime()) uptime in JavaSE 6 ? Thanks Yes and no. There are system specific ways of querying uptime (e.g. uptime on *nix) There are ways to detect the operating system . There is a small finite number of likely operating systems. And you're in a general purpose programming environment, so... so it shoudln't be a big deal that they implement it, since they are writting specific JRE for each platform, which is aware of uptime(

prometheus 监控 hadoop

北城余情 提交于 2019-12-01 02:17:13
1. run JMX exporter as a java agent with all the four daemons. For this I have added EXTRA_JAVA_OPTS in hadoop-env.sh and yarn-env.sh : [root@cloud01 hadoop]# cat yarn-env.sh |egrep -v '^$|#' export YARN_RESOURCEMANAGER_OPTS="$YARN_RESOURCEMANAGER_OPTS -javaagent:/home/ec2-user/jmx_exporter/jmx_prometheus_javaagent-0.3.1.jar=9104:/home/ec2-user/jmx_exporter/prometheus_config.yml" export YARN_NODEMANAGER_OPTS="$YARN_NODEMANAGER_OPTS -javaagent:/home/ec2-user/jmx_exporter/jmx_prometheus_javaagent-0.3.1.jar=9105:/home/ec2-user/jmx_exporter/prometheus_config.yml" [root@do1cloud01 hadoop]# cat

JMX学习以及在log4j中的应用

匆匆过客 提交于 2019-12-01 01:23:47
前言 JMX即Java Managemen Extensions,是一个为应用程序植入管理功能的框架。一套标准的代理和服务,实际上,用户可以在任何Java应用程序中使用这些代理和服务实现管理。 常常在编程的过程中有一些配置信息需要动态的进行改变,我以往会有如下几种做法: 写死在Java code中,环境发生变化的时候修改Java code 写在名为*.properties的配置文件里,使用Java读取配置文件 然而今天我们将引入一种高级的方式来进行配置信息的管理,那便是JMX的引入。 如何使用JMX JMX做为一份规范,JDK中提供了JMX接口,因此安装了JDK后就可以开发基于JMX的代码了。 JMX具有两层结构,各层的组件如下 工具层 Mbeans 通知模型:Notification、NotificationListener Mbeans与数据类:Attribute、Operator 代理层 MBean Server 代理服务 下面学习下log4j2对JMX的支持 JMX-log4j2 Log4j 2 开始支持 JMX. StatusLogger, ContextSelector, 和所有的 LoggerContexts, LoggerConfigs 以及 Appenders 使用了MBeans并且可以被远程检测和控制. 使JMX生效 默认情况下JMX是生效的

Kafka Consumer - JMX Properties

倖福魔咒の 提交于 2019-12-01 01:14:28
I enabled JMX on the kafka brokers on port 8081. When I view the MBean properties in jConsole, I only see the following for kafka.consumer - kafka.consumer:type=FetchRequestAndResponseMetrics,name=FetchRequestRateAndTimeMs,clientId=ReplicaFetcherThread-2-413 kafka.consumer:type=FetchRequestAndResponseMetrics,name=FetchResponseSize,clientId=ReplicaFetcherThread-0-413 But none of the other ones that are identified in here under Kafka Consumer Metrics are emitted by JMX. Kafka Version # 0.8.2.1 I am specifically interested in - kafka.consumer:type=ConsumerFetcherManager,name=MaxLag,clientId=([-.

access Mbeans on weblogic

非 Y 不嫁゛ 提交于 2019-12-01 00:54:46
From the documentation of oracle : Domain Runtime MBean Server : This MBean server also acts as a single point of access for MBeans that reside on Managed Servers. what i want to do is to use this fact to access all my custom mBeans scattered in several managed servers. for example assume that i have two nodes server-1 server-2 . how can i access all of the custom mBeans on both server-1 server-2 by connecting to the administrator node ? i dont want to remotly access each node to return the result i want a single entry point i managed to get the names of the servers and the states and other

Kafka集群及监控安装指南

和自甴很熟 提交于 2019-12-01 00:22:47
kafka官网:http://kafka.apache.org/ 官方文档:http://kafka.apache.org/documentation.html#quickstart kafka集群安装 下载: kafka_2.10-0.8.2.0.tar.gz 解压: tar -zxvf kafka_2.10-0.8.2.0 .tgz 软链接配置: ln -s kafka_2.10-0.8.2.0 kafka 修改配置文件 : cd kafka/config vi server.properties server.properties 配置说明(仅对需要留意的说明) : broker.id=0 // 这个ID是唯一标示,须唯一 port=9092 // 访问端口,默认为 9092 host.name=kafka-server1 // 多块网卡时,需注意。 num.io.threads=10 // disk I/O 线程数,挂多块盘的时候,应大于硬盘数 log.dirs=/home/kafka/data/kafka-logs // 存放kafka topic数据的地址,很重要,别配错 log.retention.hours=168 // 数据缓存周期,默认为7天,硬盘不够时可以调小 zookeeper.connect=zk-server1:2181,zk-server2:2181

zabbix监控logstash的java

旧街凉风 提交于 2019-11-30 22:11:00
Logstash 是一个运行在 JVM 上的软件,也就意味着 JMX 这种对 JVM 的通用监控方式对 Logstash 也是一样有效果的。要给 Logstash 启用 JMX,需要修改 ./bin/logstash.lib.sh 中 $JAVA_OPTS 变量的定义,或者在运行时设置 LS_JAVA_OPTS 环境变量。 在 ./bin/logstash.lib.sh 第 34 行 JAVA_OPTS=”$JAVA_OPTS -Djava.awt.headless=true” 下,添加如下几行: [root@monitor logstash]# vim bin/logstash.lib.sh JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote" JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=9010" JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.local.only=false" JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false" JAVA_OPTS="$JAVA_OPTS -Dcom.sun

prometheus 监控jvm-tomcat

懵懂的女人 提交于 2019-11-30 19:17:05
1.prometheus的配置 - job_name: 'java01' #按照这个来分组 scrape_interval: 10s static_configs: - targets: ['192.168.1.44:6060'] labels: instance: jvm44 2. jmx-exporter/simple-config.yml #tomcat的启动参数文件 [root@k8s prom-jvm-demo]# cat simple-config.yml --- rules: - pattern: '.*' 这个文件在启动docker的时候用到 docker run -d \ --name tomcat-1 \ -v <path-to-prom-jvm-demo>:/jmx-exporter \ -e CATALINA_OPTS="-Xms64m -Xmx128m -javaagent:/jmx-exporter/jmx_prometheus_javaagent-0.3.1.jar=6060:/jmx-exporter/simple-config.yml" \ -p 6060:6060 \ -p 8080:8080 \ tomcat:8.5-alpine 来源: https://www.cnblogs.com/hixiaowei/p/11637042.html

Is it a possible to invalidate an individual session in JBoss through JMX?

不想你离开。 提交于 2019-11-30 17:25:04
问题 We are tracking down some memory issues in our application and we have visibility into the size of our sessions where the problem seems to be. It is only affecting certain sessions where they seem to balloon out of control and we'd like to have the ability to invalidate those sessions more-or-less 'by hand' to reclaim that memory . Is there a way to do this through JMX? We are using JBoss 4.5.2 . Thanks in advance. 回答1: The answer is yes, you can. --this gets the web module MBeans loaded in