---
title: " jconsole connect to jmx management on linux server"
author: "dikar"
date: "2009-11-29T17:08:43Z"
tags: []
slug: "jconsole-connect-to-jmx-management-on-linux-server"
draft: false
lastmod: "2009-11-29T17:08:43Z"
id: 534109
url: "https://dikar.iteye.com/blog/534109"
---

转载自：http://blog.csdn.net/mengxuwq/archive/2007/07/03/1677742.aspx

 

 

You should check the following:

- Check if the hostname correctly resolves to the host address.
  
  Run `"hostname -i"` command. If it reports 127.0.0.1, JConsole would not be able to connect to the JVM running on that Linux machine. To fix this issue, edit /etc/hosts so that the hostname resolves to the host address.
- Check if the Linux machine is configured to accept packets from the host where JConsole runs on to connect to the application.
  
  Packet filtering is built in the Linux kernel. You can run `"/sbin/iptables --list"` to determine if an external client is allowed to connect to the JMX agent created for remote management. You can use the following command to add a rule to allow an external client such as JConsole to connect:
  
  `/usr/sbin/iptables -I INPUT -s jconsole-host -p tcp --destination-port jmxremote-port -j ACCEPT`
  
  where *jconsole-host* is either the hostname or the host address on which JConsole runs on and *jmxremote-port* is the port number set for `com.sun.management.jmxremote.port` for remote management.