0

I run a karaf container on an AWS server. With a little Java program, I can locally access the JMX data of it via service URL service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf-root Login is secured with username and password

But I cannot access it remotely, e.g. from my PC to the AWS server.

  • I already tried configuring the right IP of the server for JMX in karaf and of course in the service URL (instead of 0.0.0.0, which should link to all IPs of the server, right?)
  • I opened all ports of the server for testing, but no connection either
  • I tunneled ports 1099 and 44444 via SSH connection
  • I tried tunneling additional ports the karaf process listens to

Nothing has helped so far.

Current karaf configuration in org.apache.karaf.management.cfg:

rmiRegistryPort = 1099
rmiRegistryHost = 0.0.0.0 (tested 127.0.0.1 and the correct IP of the server)
rmiServerPort = 44444
rmiServerHost = 0.0.0.0 (tested 127.0.0.1 and the correct IP of the server)
serviceUrl = service:jmx:rmi://${rmiServerHost}:${rmiServerPort}/jndi/rmi://${rmiRegistryHost}:${rmiRegistryPort}/karaf-${karaf.name}
authenticatorType = password
secured = false

Current error message is:

java.rmi.ConnectException: Connection refused to host: 172.31.28.52; nested exception is: 
java.net.ConnectException: Connection timed out: connect
java.rmi.ConnectException: Connection refused to host: 172.31.28.52; nested exception is: 
java.net.ConnectException: Connection timed out: connect

Did I miss something? Is there any configuration which might block requests from outside the actual server?

Arne
  • 1
  • 1

1 Answers1

0

Seems like I was focusing on the wrong end of the rope here.

The problem was the AWS itself, as the server only knows its local IP.

If you configure the JAVA option

java.rmi.server.hostname=<public EC2 hostname>

in $KARAF_HOME/etc/system.properties, the connection can be established.

Arne
  • 1
  • 1