jmx

Why does JMX connection to Amazon EC2 fail?

不打扰是莪最后的温柔 提交于 2019-11-29 10:52:41
I set up JMX on one of services running on Amazon EC2 instance but it doesn't work properly. I'm using VisualVM to connect and after short period of pending it fails with timeout. Looks like it fails because of missing response data or lags. I checked that JMX port is enabled in security group and also tried with different port with no JMX enabled and also with port not enabled in security group settings and both fails immediately, so it looks different. My EC2 instance and desktop both have Ubuntu 12.04 and JDK 7 installed. It turns out ports don't make sense since connection is SSL secured.

When using a JMX server with ephemeral port, how to get the server port number?

人走茶凉 提交于 2019-11-29 06:12:51
When launching a Java application with these options: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=0 -Dcom.sun.management.jmxremote.local.only=false Java uses an ephemeral port, which is very useful to avoid collisions. Is it possible to get the actual port (or connection URL) programmatically from within the application ? String url = sun.management.ConnectorAddressLink.importRemoteFrom(0) .get("sun.management.JMXConnectorServer.0.remoteAddress"); System.out.println(url); This will

Getting server address and application name

…衆ロ難τιáo~ 提交于 2019-11-29 04:23:30
Environment: NetBeans 6.9.1, GlassFish 3.1 I have a Java Web Application. How to get the server address and the application name dynamically? The '2in1' solution would be the best for me: http://localhost:8080/AppName/ . Is there a practical way to get that information? Let's say the value of AppName will be fixed, so I only need the host address. Is it possible to retrieve it via JMX? Any other ways? Simon G. The HttpServletRequest object will give you what you need: HttpServletRequest#getLocalAddr() : The server's IP address as a string HttpServletRequest#getLocalName() : The name of the

Programatically get heap info using jmx with java 5

狂风中的少年 提交于 2019-11-29 03:55:29
问题 I am aware of using jconsole to attach to a java process to get memory information. Specifically I'm after getting information on the various memory pools programatically so I can tie it to a monitoring application. Thanks! 回答1: Thanks mattk - I wound up doing basically this :-) List memBeans = ManagementFactory.getMemoryPoolMXBeans(); for (Iterator i = memBeans.iterator(); i.hasNext(); ) { MemoryPoolMXBean mpool = (MemoryPoolMXBean)i.next(); MemoryUsage usage = mpool.getUsage(); String name

Where to download JMXMP?

邮差的信 提交于 2019-11-29 03:41:51
问题 I want to profile a Java application with VisualVM, remotely via JMX. Because it's a NAT'ted and firewalled EC2 instance, I can't use the default RMI approach and need to use the optional JMXMP extensions, which I must first download. NOTE – IF YOU WANT TO USE A JMXMP CONNECTOR, DOWNLOAD THE JSR 160 REFERENCE IMPLEMENTATION FROM , AND ADD THE JMXREMOTE_OPTIONAL.JAR FILE TO YOUR CLASSPATH. YOU WILL FIND EXAMPLES OF USE OF THE JMXMP CONNECTORS IN THE JMX REMOTE API TUTORIAL INCLUDED WITH THE

CPU and profiling not supported for remote jvisualvm session

十年热恋 提交于 2019-11-29 02:49:12
问题 When monitoring a remote app (using jstatd) I can neither profile nor monitor CPU consumption. Heap monitoring (provided I do not use G1) works. jvisualvm provides the message "Not supported for this JVM." in the CPU graph window. Is there anything missing in my setup? Google showed very few results. The local environment (Mac OS X 10.6): java version "1.6.0_15" Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219) Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode) The

Debugging JConsole Connection Failed

元气小坏坏 提交于 2019-11-29 02:01:34
问题 I have a web application deployed to a remote resin server, and it has JMX turned on. I can telnet to the remote server i.e franz@see:/tmp$ telnet <remote-ip> 5555 Trying <remote-ip>... Connected to <remote-ip>. Escape character is '^]'. ��sr5javax.management.remote.message.HandshakeBeginMessage�,���6profilestLjava/lang/String;Lversionq~xppt1.0^] telnet> q Connection closed. But I cannot connect to it using my JConsole $JAVA_HOME/bin/java -cp $JAVA_HOME/lib/jconsole.jar:$JAVA_HOME/lib/tools

Docker那些事儿之镜像创建

别等时光非礼了梦想. 提交于 2019-11-29 01:56:23
之前已经了解了docker的基本使用方式,简单的上手,也能让大部分人了解到这个技术的使用方法,今天继续说明docker如何构建自己所需要的镜像,开发人员掌握使用基础即可,有兴趣的可以自行深入研究 前言 docker的相关操作命令不是本文的重点部分,自行查找资料或去官网学习,另外,docker也有其api接口(类似restful api),需要使用时需要进行设置开启api端口,具体参照官网 本文主要说明创建自己所需要的镜像,由于经常需要根据开发人员或运维人员的需求内置一些组件,而公共的docker镜像不能满足其需要,就需要自行根据需求创建镜像,本文主要说明创建镜像的相关操作,不会过于深入,毕竟笔者也不属于系统运维人员,只进行基础的镜像创建说明 需求说明 由于系统运维人员需要Tomcat开启其JMX功能来监控服务的各个属性,而目前官方镜像上也没有这种定制的镜像,故我们需要自行构建 JMX简介 JMX(Java Management Extensions): JMX是用于管理和监控JAVA应用的接口规范,同时具有以下特点: 通过JMX的”MBeans“来读取数据 可以读取和写入MBean的属性 可以执行MBean的方法 我们都熟悉JAVA中的反射,而JMX的整体实现和作用,和反射有很大的相似性。只是JMX允许执行远程主机上的目标方法。通过JMX,可以轻松获取JVM的各项数据值

docker 搭建zookeeper集群和kafka集群

守給你的承諾、 提交于 2019-11-29 01:56:02
docker 搭建zookeeper集群 安装docker-compose容器编排工具 Compose介绍 Docker Compose 是 Docker 官方编排(Orchestration)项目之一,负责快速在集群中部署分布式应用。 Compose 项目是 Docker 官方的开源项目,负责实现对 Docker 容器集群的快速编排。Compose 定位是 「定义和运行多个 Docker 容器的应用(Defining and running multicontainer Docker applications)」,其前身是开源项目 Fig。 使用一个 Dockerfile 模板文件,可以让用户很方便的定义一个单独的应用容器。然而,在日常工作中,经常会碰到需要多个容器相互配合来完成某项任务的情况。例如要实现一个 Web 项目,除了 Web 服务容器本身,往往还需要再加上后端的数据库服务容器,甚至还包括负载均衡容器等。 Compose 恰好满足了这样的需求。它允许用户通过一个单独的 docker-compose.yml 模板文件(YAML 格式)来定义一组相关联的应用容器为一个项目(project)。 Compose 中有两个重要的概念: 服务 ( service ):一个应用的容器,实际上可以包括若干运行相同镜像的容器实例 项目 ( project )

Connection details & timeouts in a java web service client

我只是一个虾纸丫 提交于 2019-11-29 01:37:18
问题 I have to implement a webservice client to a given WSDL file. I used the SDK's 'wsimport' tool to create Java classes from the WSDL as well as a class that wrap's the webservice's only method ( enhanceAddress(auth, param, address) ) into a simple java method. So far, so good. The webservice is functional and returning results correcty. The code looks like this: try { EnhancedAddressList uniservResponse = getWebservicePort().enhanceAddress(m_auth, m_param, uniservAddress); //Where the Port^ is