jmx

Zabbix-(六) JMX监控

纵然是瞬间 提交于 2019-12-05 06:21:06
Zabbix-(六) JMX监控 一.前言 Zabbix提供了JMX监控,它通过JMX API获取JVM信息,从而提供监控数据。本文讲述使用JMX监控Tomcat的JVM信息。 准备 Zabbix Server 4.4 (ip: 192.168.152.140) 运行Java应用的主机 以下简称Server-A (已被Zabbix监控) (ip:192.168.152.142) 二.安装Zabbix-Java-gateway Zabbix Server通过Zabbix Java gateway收集JMX监控数据,因此首先需要安装Zabbix-Java-gateway,同时修改Zabbix Server的配置。 安装Zabbix-Java-gateway 可以在其他主机安装Zabbix-Java-gateway,只需要修改Zabbix-server配置文件,指定Zabbix-Java-gateway的地址和端口,这里就在部署Zabbix Server的主机上部署Zabbix-Java-gateway。 # yum install zabbix-java-gateway 配置Zabbix-Java-gateway 配置文件是 /etc/zabbix/zabbix_java_gateway.conf 文件,文本采取默认配置,配置项详细信息可以参考下图或者参考 官方Zabbix-java

JMX enabled by default Using config: /usr/local/develope/zookeeper-clusters/zookeeper-server3/bin/.

泪湿孤枕 提交于 2019-12-05 05:25:56
JMX enabled by default Using config: /usr/local/develope/zookeeper-clusters/zookeeper-server3/bin/…/conf/zoo.cfg Error contacting service. It is probably not running. 出现这个问题有一下几种可能性: 1.防火墙没有关闭,就是对应的集群端口没有开放,所以各个节点之间没办法通信(zoo.cfg中最后自己配置的内容以及zookeeper自己的2181端口); 2.zookeeper中conf目录下的zoo.cfg配置文件有问题,查看日志dataLog文件的目录,以及data数据文件的目录是否正确; 3.myid文件中的内容是否和zoo.cfg中配 备注:查看端口是否开放lsof -i:端口号命令行,以80为例的,如果没有任何输出则说明没有开启该端口号; 下面是我自己搭建zookeeper集群的方法: 搭建zookeeper集群(注意端口号不能被占用) 1、进入到我们的zookeeper文件目录 cd /root/software/zookeeper-3.4.12 2、创建对应的目录和文件(位置可以自己定:我的位置是在zookeeper-3.4.12目录下创建的) mkdir data mkdir dataLog 3

Jafka源码粗略解读之二--关于JMX

只愿长相守 提交于 2019-12-05 04:05:05
JMX Jafka里用到了JMX,之前也没用过,迅速突击了一下,感觉还是挺简单的: 有一篇文章用一个例子介绍JMX怎么使用的,简洁明了: http://www.javalobby.org/java/forums/t49130.html 。就是声明一个bean,然后在MBeanServer中加入这个bean: ApplicationCache cache = new ApplicationCache(); MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ObjectName name = new ObjectName("org.javalobby.tnt.jmx:type=ApplicationCacheMBean"); mbs.registerMBean(cache, name); 这里ApplicationCache是个POJO,特殊的是它必须实现一个名为*MBean的接口。至此,一个JMX调用就完成了。在JConsole里连接,会找到对应方法。貌似setter和getter会被打包反射成一个field,其他都是方法调用。 JMX的设计倒是非常符合Java OO的思想,使用也还算简洁,是个好东西。结构说明: http://pub.admc.com/howtos/jmx/architecture-chapt

How to connect to remote server and start/stop the Tomcat that's running on that particular server using Ant?

夙愿已清 提交于 2019-12-05 02:51:01
问题 The purpose is to: 1: connect to a remote server maybe via host: ip , port: 8181 2: stop Tomcat that's running on that server 3: deploy a .war file 4: restart tomcat 回答1: I believe Tomcat Documentation under Monitoring and Managing Tomcat offers some information on how to stop a given application, but not the server entirely: <jmx:invoke name="Catalina:type=Manager,path=/servlets-examples,host=localhost" operation="stop"/> If you have ssh access to the server, then you might like to consider

jmx/jstatd access to remote machine through an ssh tunnel

南楼画角 提交于 2019-12-05 01:03:18
I'd like to use visualvm app through an ssh tunnel (to an EC2 machine) using jmx OR jstatd. How do I do this? Here is a list of what has been tried (and failed): (BTW: if visual vm is not appropriate, how do I find memory leaks on a remote machine?) jstatd: attempt: I set up the jstatd server on the EC2 machine (app was already running on it) Then I set up a tunnel mapping local port 3333 to remote port 1099 In VisualVM I tried to connect using jstatd on port 3333 ... none of the processes on EC2 showed up This link says that jstatd opens up another port: http://rukuro-blog.heroku.com/2011/06

CDHkafka脚本

僤鯓⒐⒋嵵緔 提交于 2019-12-05 01:01:01
启动客户端的命令 /opt/cloudera/parcels/KAFKA-4.0.0-1.4.0.0.p0.1/bin/kafka-console-producer --broker-list hadoop102:9092 --topic topic_start 去上面目录下找到kafka-console-consumer #!/bin/bash # Reference: http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in SOURCE="${BASH_SOURCE[0]}" BIN_DIR="$( dirname "$SOURCE" )" while [ -h "$SOURCE" ] do SOURCE="$(readlink "$SOURCE")" [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" done BIN_DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" LIB_DIR=$BIN_DIR/../lib # Autodetect JAVA_HOME

Getting Active Session counts with JMX (Java Management Extensions) API

微笑、不失礼 提交于 2019-12-04 22:39:50
问题 I'm trying to use JMX API to get active session counts for a web application. Is it possible to use JMX API to get this kind of information? If yes, how reliable would it be? Any example code on how to get this done? I've been reading JMX tutorial and documentation, but they are giving me the overview of what the technology is. I just can't pinpoint to what I need, yet. 回答1: You can accomplish this by using something like JConsole or JVisualVM once you configure your app server to expose a

How to monitor JMX metrics of Kafka broker on command line?

廉价感情. 提交于 2019-12-04 21:41:41
问题 A Kafka cluster can be monitored in granular detail via the JMX metrics it exposes. Usually an external GUI or application like jconsole needs to be hooked up to a broker's exposed JMX_PORT in order to view these metrics. Is there a way that I can view a broker's JMX metrics in an SSH session, via STDOUT ? Is there a native Kafka command that I can run to view these metrics? 回答1: Download the jar located here: https://sourceforge.net/projects/cyclops-group/files/jmxterm/1.0-alpha-4/ On the

Java daemon deployment

帅比萌擦擦* 提交于 2019-12-04 20:25:01
I have a console Java application, which runs all the time on a remote server (nohup java -jar myapp.jar &). Frequently (every other day) I need to replace the JAR file by a newer one (whenever I fix a defect). At the moment I do this by connecting to the server using ssh (WinSCP). How can I create a mechanism, using which I could upgrade the application via the http protocol? Can I use JMX for that? That mechanism should do following things: a) Stop the currently running application. b) Upload the new JAR file to the server. c) Launch the new JAR file. Basically you need to break down the

Accessing JMX via HTTP alternatives

风格不统一 提交于 2019-12-04 20:21:48
问题 We use MX4J to access JMX related operations/attributes via a web interface in the container itself. I wanted to know if there are alternatives that are available for it, since the last service release for MX4J was in 2006. I am basically looking to overcome limitations of MX4J in handling collections. 回答1: I was experimenting once with Jolokia and looks pretty cool. From the webpage: Jolokia is an HTTP/JSON bridge for remote JMX access. Definitely give it a try. I used it successfully to