In the previous article, we demonstrated the first Cluster Orchestration solution supported by Photon Controller by deploying a fully functional Kubernetes Cluster using Photon Controller. In this article, we will now look at deploying a Mesos Cluster using Photon Controller.

test-driving-photon-controller-mesos-cluster
The minimal deployment for a Mesos Cluster in Photon Controller consists of 6 Virtual Machines: 3 Masters, 1 Zookeeper, 1 Marathon & 1 Slave. If you only have 16GB of memory on your ESXi host, then you will need to override the default VM Flavor when deploying a Mesos Cluster. If you have more than 16GB of available memory, then you can skip Step 1 and move to Step 2 directly.

Deploying Mesos Cluster

Step 1 - If you have not already created a new cluster-tiny-vm VM Flavor from the previous article that consists of 1vCPU/1GB memory, please run the following command:

./photon -n flavor create --name cluster-tiny-vm --kind "vm" --cost "vm 1 COUNT,vm.flavor.cluster-other-vm 1 COUNT,vm.cpu 1 COUNT,vm.memory 1 GB,vm.cost 1 COUNT"

Step 2- Download the Mesos VMDK from here

Step 3 - We will now upload our Mesos image and make a note of the ID that is generated after the upload completes by running the following command:

./photon -n image create photon-mesos-vm-disk1.vmdk -n photon-meos-vm.vmdk -i EAGER

Step 4 - Next, we will also need the ID of our Photon Controller Instance deployment as it will be required in the next step by running the following command:

./photon deployment list

Step 5 - We will now enable the Mesos Cluster Orchestration on our Photon Controller instance by running the following command and specifying the ID of your deployment as well as the ID of the Mesos image from the previous two steps:

./photon -n deployment enable-cluster-type 569c3963-2519-4893-969c-aed768d12623 -k MESOS -i 51c331ea-d313-499c-9d8f-f97532dd6954

test-driving-photon-controller-meso-1
Step 6 - We are now ready to spin up our Mesos Cluster by simply running the following command and substituting the network information from your environment. We are going to only deploying a single Mesos Slave (if you have additional resources you can spin up more or you can always re-size the cluster after it has been deployed). Do not forget to override the default VM Flavor used by specifying -v option and providing the name of our VM Flavor which we had created earlier called cluster-tiny-vm. You can just hit enter when prompted for the two zookeeper IP Addresses.

./photon cluster create -n mesos-cluster -k MESOS --dns 192.168.1.1 --gateway 192.168.1.1 --netmask 255.255.255.0 --zookeeper1 192.168.1.45 -s 1 -v cluster-tiny-vm

test-driving-photon-controller-meso-2
Step 7 - The process can take a few minutes and you should see a message like the one shown above which prompts you to run the cluster show command to get more details about the state of the cluster.

./photon cluster show bf962c3a-28a2-435d-bd96-0313ca254667

test-driving-photon-controller-meso-3
At this point, you have now successfully deployed a Mesos cluster running on Photon Controller. What you will be looking for in this screen is the IP Address of the Marathon VM which is the management interface to Mesos. We will need this IP Address in the next section if you plan to explore Mesos a bit more.

Exploring Mesos

Using the IP Address obtained from the previous step, you can now open a web browser and enter the following: http://[MARATHON-IP]:8080 which should launch the Marathon UI as shown in the screenshot below. If you wish to deploy a simple application using Marathon, you can follow the workflow here. Since we deployed Mesos using a tiny VM Flavor, we would not be able to exercise the final step of deploying an application running on Mesos. If you have more resources, I definitely recommend you give the workflow a try.

test-driving-photon-controller-meso-4
In our last and final article of the series, we will be covering the last Cluster Orchestration supported on Photon Controller which is Docker Swarm.

3 thoughts on “Test driving VMware Photon Controller Part 3b: Deploying Mesos

  1. Hi William,

    Thanks for the great posts over the last few days, but I have a question. How could VRA and Photon Controller work together? I am struggling with figuring out a way forward and not have multiple management services.

    • There’s no integration today afaik. They have slightly different purposes and although Photon Controller could be made into an endpoint w/vRA using the Photon Controller’s APIs, I’ve not seen anything yet.

  2. Facing challenges with Mesos cluster. Not sure what I am missing though I could have the Kubernetes cluster up and running fine before. I do have the DHCP server running in my setup. Appreciate if you could provide me any advice.
    thanks!

    ——

    [student@jumpbox ~]$ photon cluster create -n mesos-cluster -k MESOS –dns 172.16.10.250 –gateway 172.16.10.253 –netmask 255.255.255.0 –zookeeper1 172.16.10.37 -s 1 -v cluster-tiny-vm
    Using target ‘http://172.16.10.30:28080’
    Zookeeper server 2 static IP address (leave blank for none):

    Creating cluster: mesos-cluster (MESOS)
    VM flavor: cluster-tiny-vm
    Slave count: 1

    Are you sure [y/n]? y
    2016/07/04 08:16:49 photon: Task ‘d84b5e85-7888-4bbd-8b80-126654745c09’ is in error state: {@step=={“sequence”=>”2″,”state”=>”ERROR”,”errors”=>[photon: { HTTP status: ‘0’, code: ‘InternalError’, message: ‘Failed to rollout MesosMaster. Error: MultiException[java.lang.IllegalStateException: ClusterWaitTaskService failed with error Wait period expired. /photon/clustermanager/wait-for-cluster-tasks/c62cc71a-b026-4922-831f-e9bf35c22fbf]’, data: ‘map[]’ }],”warnings”=>[],”operation”=>”CREATE_MESOS_CLUSTER_SETUP_MASTERS”,”startedTime”=>”1467644688000″,”queuedTime”=>”1467644617000″,”endTime”=>”1467645408000″,”options”=>map[]}}
    API Errors: [photon: { HTTP status: ‘0’, code: ‘InternalError’, message: ‘Failed to rollout MesosMaster. Error: MultiException[java.lang.IllegalStateException: ClusterWaitTaskService failed with error Wait period expired. /photon/clustermanager/wait-for-cluster-tasks/c62cc71a-b026-4922-831f-e9bf35c22fbf]’, data: ‘map[]’ }]
    —–

Thanks for the comment!