Search code examples
javaamazon-web-servicesiphostrundeck

Why Rundeck redirect to ec2 private ip on aws if using public ip?


  • Public ip is: 12.34.56.78(fake).
  • Private ip is: 21.43.65.87(fake).
  • Hostname is ip-21.43.65.87(fake).

When access:

http://12.34.56.78:4440

Redirected to:

http://ip-21-34-65-87:4440/menu/home

From the official document, there is a notice:

server.http.host Address/hostname to listen on, default is all addresses "0.0.0.0"

So I tried to start rundeck using that option:

java -XX:MaxPermSize=256m -Xmx1024m -jar -Dserver.http.host="12.34.56.78" rundeck-launcher-2.0.0.jar

It said can't use that address. Why?


Edit

After ran start command:

        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
        at com.dtolabs.rundeck.RunServer.run(RunServer.java:128)
        at com.dtolabs.rundeck.RunServer.main(RunServer.java:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.dtolabs.rundeck.ExpandRunServer.invokeMain(ExpandRunServer.java:758)
        at com.dtolabs.rundeck.ExpandRunServer.execute(ExpandRunServer.java:715)
        at com.dtolabs.rundeck.ExpandRunServer.run(ExpandRunServer.java:313)
        at com.dtolabs.rundeck.ExpandRunServer.main(ExpandRunServer.java:117)
2018-06-08 03:53:11.824:WARN:oejuc.AbstractLifeCycle:main: FAILED org.eclipse.jetty.server.Server@6fc26fb1: java.net.BindException: Cannot assign requested address
java.net.BindException: Cannot assign requested address
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:264)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
        at org.eclipse.jetty.server.Server.doStart(Server.java:303)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
        at com.dtolabs.rundeck.RunServer.run(RunServer.java:128)
        at com.dtolabs.rundeck.RunServer.main(RunServer.java:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.dtolabs.rundeck.ExpandRunServer.invokeMain(ExpandRunServer.java:758)
        at com.dtolabs.rundeck.ExpandRunServer.execute(ExpandRunServer.java:715)
        at com.dtolabs.rundeck.ExpandRunServer.run(ExpandRunServer.java:313)
        at com.dtolabs.rundeck.ExpandRunServer.main(ExpandRunServer.java:117)
java.net.BindException: Cannot assign requested address
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Net.java:433)
        at sun.nio.ch.Net.bind(Net.java:425)
        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:264)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
        at org.eclipse.jetty.server.Server.doStart(Server.java:303)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
        at com.dtolabs.rundeck.RunServer.run(RunServer.java:128)
        at com.dtolabs.rundeck.RunServer.main(RunServer.java:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at com.dtolabs.rundeck.ExpandRunServer.invokeMain(ExpandRunServer.java:758)
        at com.dtolabs.rundeck.ExpandRunServer.execute(ExpandRunServer.java:715)
        at com.dtolabs.rundeck.ExpandRunServer.run(ExpandRunServer.java:313)
        at com.dtolabs.rundeck.ExpandRunServer.main(ExpandRunServer.java:117)

Solution

  • After edit public IPs in these two config files, works well.

    • ~/rundeck/etc/framework.properties
    • ~/rundeck/server/config/rundeck-config.properties