cad
cad

Reputation: 337

jconsole isn't working on ec2 machine

large instance with cassandra for test box. and try to open jconsole on the same machine. i doesnt open the jconse. if itry to set DISPLAY Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using 'hostname' as the value of the DISPLAY variable.. we dont have public ip configured for that server. what need to be done on opening the jconsole on same machie and remotley

Upvotes: 0

Views: 438

Answers (1)

LHWizard
LHWizard

Reputation: 2389

I used two ways to start jconsole on a remote ec2 server. Both require access to the private IP of the instance.

What I've found is that the ubuntu ami on AWS doesn't have an X window server by default. The first one relies on ssh to the instance via the private IP along with installing a X windows server on your workstation. On the mac, I use XQuartz. When I was using Windows, I installed Xming.

SSH with the -X or -Y flag like so: ssh -Y -i /path/to/my.pem [email protected] where you use your own keypair and private IP address.

At the bash prompt on the instance, type ubuntu@ip-10-11-12-13:~$ jconsole to start jconsole. XQuartz will start up and the jconsole window will be displayed on your local desktop.

Second, if you have jmx enabled and the jmx port opened in the security group, you can run jconsole on your local machine and connect to the remote process.

Hopefully I've read your question correctly.

Upvotes: 2

Related Questions