我在AWS服务器上运行一个karaf容器。使用一个小的Java程序,我可以通过服务访问它的JMX数据,service:jmx:rmi://127.0.0.1:44444/jndi/rmi://127.0.0.1:1099/karaf-root登录是用用户名和密码来保护的。
但是我不能远程访问它,例如从我的电脑到AWS服务器。
到目前为止,没有什么帮助。
Org.apache.karaf.management.cfg中当前的karaf配置:
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当前的错误消息是:
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我错过了什么吗?是否有任何配置可以阻止来自实际服务器之外的请求?
发布于 2017-05-24 15:04:34
好像我把注意力集中在绳子的错误一端。
问题在于AWS本身,因为服务器只知道它的本地IP。
如果配置JAVA选项
java.rmi.server.hostname=<public EC2 hostname>在$KARAF_HOME/etc/system.properties中,可以建立连接。
https://stackoverflow.com/questions/44161146
复制相似问题