Repository: aurora Updated Branches: refs/heads/master 32a8a0772 -> b76e38f9a
Add -ip option to bind scheduler to a single IP Add an -ip command line option which sets the IP that the Jetty server will listen on. Bugs closed: AURORA-572 Reviewed at https://reviews.apache.org/r/47697/ Project: http://git-wip-us.apache.org/repos/asf/aurora/repo Commit: http://git-wip-us.apache.org/repos/asf/aurora/commit/b76e38f9 Tree: http://git-wip-us.apache.org/repos/asf/aurora/tree/b76e38f9 Diff: http://git-wip-us.apache.org/repos/asf/aurora/diff/b76e38f9 Branch: refs/heads/master Commit: b76e38f9a43b4847614685ea2f4933a748ef8c2a Parents: 32a8a07 Author: Chris Bannister <[email protected]> Authored: Thu May 26 13:33:29 2016 -0500 Committer: Joshua Cohen <[email protected]> Committed: Thu May 26 13:33:29 2016 -0500 ---------------------------------------------------------------------- RELEASE-NOTES.md | 2 ++ .../org/apache/aurora/scheduler/http/JettyServerModule.java | 8 ++++++++ 2 files changed, 10 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/aurora/blob/b76e38f9/RELEASE-NOTES.md ---------------------------------------------------------------------- diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 4cbf92e..6e878c5 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -22,6 +22,8 @@ - Upgraded to pystachio 0.8.1 to pick up support for the new [Choice type](https://github.com/wickman/pystachio/blob/v0.8.1/README.md#choices). - The `container` property of a `Job` is now a Choice of either a `Container` holder, or a direct reference to either a `Docker` or `Mesos` container. +- New scheduler command line argument `-ip` to control what ip address to bind the schedulers http + server to. ### Deprecations and removals: http://git-wip-us.apache.org/repos/asf/aurora/blob/b76e38f9/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java b/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java index 60667fc..4faf53f 100644 --- a/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java +++ b/src/main/java/org/apache/aurora/scheduler/http/JettyServerModule.java @@ -115,6 +115,10 @@ public class JettyServerModule extends AbstractModule { help = "The port to start an HTTP server on. Default value will choose a random port.") protected static final Arg<Integer> HTTP_PORT = Arg.create(0); + @CmdLine(name = "ip", + help = "The ip address to listen. If not set, the scheduler will listen on all interfaces.") + protected static final Arg<String> LISTEN_IP = Arg.create(); + public static final Map<String, String> GUICE_CONTAINER_PARAMS = ImmutableMap.of( FEATURE_POJO_MAPPING, Boolean.TRUE.toString(), PROPERTY_CONTAINER_REQUEST_FILTERS, GZIPContentEncodingFilter.class.getName(), @@ -377,6 +381,10 @@ public class JettyServerModule extends AbstractModule { ServerConnector connector = new ServerConnector(server); connector.setPort(HTTP_PORT.get()); + if (LISTEN_IP.hasAppliedValue()) { + connector.setHost(LISTEN_IP.get()); + } + server.addConnector(connector); server.setHandler(getGzipHandler(getRewriteHandler(rootHandler)));
