Hey Tim,

Thanks for mentioning the EC2 "meta-data" endpoints. My expectation was
that these endpoints would be used for setting the slave's hostname, i.e.,
mesos-slave --hostname=`curl
http://169.254.169.254/2012-01-12/meta-data/public-hostname`.

Unfortunately, we store the _IP address_ of the masters and since the
public hostnames resolve to a private IP address within EC2 we end up
storing the private IP address! Thus, when we try and get the hostname for
one of the master's IP addresses we get the private hostname. If there was
a way to get a public hostname from a private IP that would solve this
problem, but none exists on EC2 that I know of.

Ben.


On Mon, Dec 9, 2013 at 12:46 PM, Tim St Clair <tstcl...@redhat.com> wrote:

> inline
>
> ------------------------------
>
> *From: *"Benjamin Hindman" <benjamin.hind...@gmail.com>
>
> *To: *"dev" <d...@mesos.apache.org>, user@mesos.apache.org
> *Sent: *Monday, December 9, 2013 2:06:36 PM
> *Subject: *mesos and ec2
>
>
> If you don't use Mesos on EC2 then you can likely stop reading this email.
>
> When using Mesos on EC2 you might notice that the web UI seems broken. The
> two things we know about are:
>
> (1) You can't use '/master/redirect' on a master because it attempts to
> send you to the private IP hostname of the leading master (which obviously
> your browser can't connect to).
>
>
> Why not use a simple detection mechanics:
>
> my_hostname=$(hostname -f)
>
> curl --connect-timeout 3 --silent http://169.254.169.254/2012-01-12
> if [ $? -eq 0 ]; then
>   my_hostname=$(curl
> http://169.254.169.254/2012-01-12/meta-data/public-hostname)
>   echo "Found EC2 public hostname: $my_hostname"
> fi
>
>
>
> (2) You can't get information from the slaves (and thus, information about
> your tasks such as file download/tailing) because your browser tries to
> connect to the slave's private hostname.
>
> same details as above.
>
>
>
> We're trying to architect a clean fix for (1) in 
> MESOS-672<https://issues.apache.org/jira/browse/MESOS-672>.
> Feel free to follow along and please add any suggestions. In the mean time,
> the best solution that we know of is to modify /etc/hosts *on the masters* to
> resolve the public hostname from the private IP.
>
> For (2) you can set the --hostname flag on the slave to the public
> hostname. Within EC2 the public hostname will resolve to the private IP
> address so you won't be paying extra traffic fees but your browser will
> also be able to get the public IP address from the public hostname.
>
> Of course, don't forget to set up your security groups to make sure the
> master and slave port(s) are open (5050 and 5051 by default respectively).
>
> We plan to make these fixes less of a manual process in the future and
> would love to hear your suggestions!
>
> Thanks,
>
> Ben.
>
>
>
>
> --
> Cheers,
> Tim
>

Reply via email to