Problem scenario
You want to install Apache Mesos and Apache Marathon to an Ubuntu 16.x Linux server in AWS. How do you do this?
Prerequisites
You need two Linux instances with relevant Security Group rules added to allow for connectivity between the two. One Ubuntu Linux server will be for the Mesos master and the other server will be for the Mesos slave. You also need to be able to use a web browser to the Mesos master server. You can use Apache Mesos and Marathon with other distributions of Linux. This solution happens to use Ubuntu.
Solution
Steps 1 through 8 will all be done on the server that will become the Apache Mesos master server.
1. On the server that will be the Apache Mesos master server, run these commands:
sudo apt-get -y update
sudo apt-get -y install zookeeperd
2. Run this command:sudo service zookeeper status
# Enter these characters without the quote marks ":q" to escape
3. Run this command:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv DF7D54CBE56151BF
4.a. Create this file /etc/apt/sources.list.d/mesosphere.list
4.b. This file above should have this line:
deb http://repos.mesosphere.com/ubuntu xenial main
5. Run these commands:sudo apt-get -y update
sudo apt-get -y install mesos
6. Create this file /etc/mesos-master/advertise_ip
It should have the external IP address of the server:
x.x.x.x
To find what x.x.x.x should be if you do not know it, run "curl http://icanhazip.com" with no quotes from the master.
7. Create this file /etc/mesos-slave/advertise_ip
It should have the external IP address of the server:
y.y.y.y
To find what y.y.y.y should be if you do not know it, run "curl http://icanhazip.com" with not quotes from the slave.
8. Run this command:sudo service mesos-master start
Steps 9 through 16 should be done on the server that will be the Apache Mesos slave server.
9. Go to the server that will be the Mesos slave. Run these commands:
sudo apt-get -y update
sudo apt-get -y install zookeeperd
10. Now run this command:sudo service zookeeper status
# Enter these characters without the quote marks ":q" to escape
11. Run this command:sudo apt-key adv --keyserver keyserver.ubuntu.com --recv DF7D54CBE56151BF
12.a. Create this file /etc/apt/sources.list.d/mesosphere.list
12.b. The file above should have this line:
deb http://repos.mesosphere.com/ubuntu xenial main
13. Now run these commands:sudo apt-get -y update
sudo apt-get -y install mesos
14. Create this file /etc/mesos-master/advertise_ip
It should have the external IP address of the server:
x.x.x.x
To find what x.x.x.x should be if you do not know it, run "curl http://icanhazip.com" with not quotes from the master.
15. Create this file /etc/mesos-slave/advertise_ip
It should have the external IP address of the server:
y.y.y.y
To find what y.y.y.y should be if you do not know it, run "curl http://icanhazip.com" with not quotes from the slave.
16. Now run this command:sudo service mesos-slave start
17. Go back to the Mesos master server. Run these commands:sudo apt-get -y install marathon
sudo service marathon start
You are done.
18. Optional step: Now you can open a web browser knowing what the external IP address of the Mesos master server is. To see the Mesos web UI, go here (where x.x.x.x is the external IP address of the Mesos master): x.x.x.x:5050
To see the Marathon web UI, go here (where x.x.x.x is the external IP address of the Mesos master): x.x.x.x:8080