You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by vi...@apache.org on 2015/11/19 21:09:17 UTC

mesos git commit: Added 2 slave flags --advertise_ip and --advertise_port.

Repository: mesos
Updated Branches:
  refs/heads/master 2a15af346 -> bb5c44a7a


Added 2 slave flags --advertise_ip and --advertise_port.

If set, these IP/Port shall be advertised by libprocess (although bind
is not done on this IP/Port). If not set, libprocess advertises the
IP/Port on which bind was done.

Command line arguments added:
advertise_ip: IP address advertised to reach mesos slave.
advertise_port: Port advertised to reach mesos slave (used with advertise_ip).

Review: https://reviews.apache.org/r/40459


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/bb5c44a7
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/bb5c44a7
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/bb5c44a7

Branch: refs/heads/master
Commit: bb5c44a7a6fead84789c933a9aa3e1a8cf35722d
Parents: 2a15af3
Author: Anindya Sinha <an...@apple.com>
Authored: Thu Nov 19 12:08:05 2015 -0800
Committer: Vinod Kone <vi...@gmail.com>
Committed: Thu Nov 19 12:08:41 2015 -0800

----------------------------------------------------------------------
 docs/configuration.md | 39 ++++++++++++++++++++-------------------
 src/slave/main.cpp    | 23 +++++++++++++++++++++++
 2 files changed, 43 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/bb5c44a7/docs/configuration.md
----------------------------------------------------------------------
diff --git a/docs/configuration.md b/docs/configuration.md
index 72847e5..e195b17 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -34,6 +34,26 @@ If you have special compilation requirements, please refer to `./configure --hel
 
   <tr>
     <td>
+      --advertise_ip=VALUE
+    </td>
+    <td>
+      IP address advertised to reach mesos master/slave. Mesos master/slave
+      does not bind using this IP address. However, this IP address may be
+      used to access Mesos master/slave.
+    </td>
+  </tr>
+  <tr>
+    <td>
+      --advertise_port=VALUE
+    </td>
+    <td>
+      Port advertised to reach mesos master/slave (alongwith advertise_ip).
+      Mesos master/slave does not bind using this port. However, this port
+      (alongwith advertise_ip) may be used to access Mesos master/slave.
+    </td>
+  </tr>
+  <tr>
+    <td>
       --external_log_file=VALUE
     </td>
     <td>
@@ -175,25 +195,6 @@ If you have special compilation requirements, please refer to `./configure --hel
       </th>
     </tr>
   </thead>
-   <tr>
-     <td>
-      --advertise_ip=VALUE
-    </td>
-    <td>
-      IP address advertised to reach mesos master. Mesos master does not bind using this
-      IP address. However, this IP address may be used to access Mesos master.
-    </td>
-  </tr>
-  <tr>
-    <td>
-      --advertise_port=VALUE
-    </td>
-    <td>
-      Port advertised to reach mesos master (alongwith advertise_ip). Mesos master does not
-      bind using this port. However, this port (alongwith advertise_ip) may be used to
-      access Mesos master.
-    </td>
-  </tr>
   <tr>
     <td>
       --quorum=VALUE

http://git-wip-us.apache.org/repos/asf/mesos/blob/bb5c44a7/src/slave/main.cpp
----------------------------------------------------------------------
diff --git a/src/slave/main.cpp b/src/slave/main.cpp
index 746eec6..3995ae3 100644
--- a/src/slave/main.cpp
+++ b/src/slave/main.cpp
@@ -101,6 +101,21 @@ int main(int argc, char** argv)
   uint16_t port;
   flags.add(&port, "port", "Port to listen on", SlaveInfo().port());
 
+  Option<string> advertise_ip;
+  flags.add(&advertise_ip,
+            "advertise_ip",
+            "IP address advertised to reach mesos slave.\n"
+            "Mesos slave does not bind using this IP address.\n"
+            "However, this IP address may be used to access Mesos slave.");
+
+  Option<string> advertise_port;
+  flags.add(&advertise_port,
+            "advertise_port",
+            "Port advertised to reach mesos slave (alongwith advertise_ip).\n"
+            "Mesos slave does not bind using this port.\n"
+            "However, this port (alongwith advertise_ip) may be used to\n"
+            "access Mesos slave.");
+
   Option<string> master;
   flags.add(&master,
             "master",
@@ -181,6 +196,14 @@ int main(int argc, char** argv)
 
   os::setenv("LIBPROCESS_PORT", stringify(port));
 
+  if (advertise_ip.isSome()) {
+    os::setenv("LIBPROCESS_ADVERTISE_IP", advertise_ip.get());
+  }
+
+  if (advertise_port.isSome()) {
+    os::setenv("LIBPROCESS_ADVERTISE_PORT", advertise_port.get());
+  }
+
   process::initialize("slave(1)");
 
   logging::initialize(argv[0], flags, true); // Catch signals.