CiscoCloud/mantl-api

cassandra installation fails

Closed this issue · 7 comments

I am trying to run cassandra on Marathon using mantl-api.
When I run this command, I dont get any error messages and the Marathon UI always shows "waiting" status for Cassandra app -
curl --insecure -X POST -u admin -d "{"name": "cassandra"}" https://192.168.100.101/api/1/install

Can I get handle to the .json file which is being used for installation on Marathon?
That might give some visibility.
What's the best method to debug such kind of issues in mantl-api?

ryane commented

You can get the marathon json by running something like:

curl -sku admin:password https://192.168.100.101/marathon/v2/apps/cassandra/mantl

(replace mantl with you cluster-name if you customized it)

Are you running in Vagrant (I am just guessing based on the ip address)? If so, it is probably just a lack of cluster resources. By default cassandra wants to run 3 nodes so you probably have to customize it on smaller clusters. Here is an example of a customized cassandra config that only launches a single node:

https://github.com/CiscoCloud/mantl/blob/master/examples/kong/cassandra.json

You may still have to adjust the mem/cpu resources depending on your environment. The config.json in the package (https://github.com/CiscoCloud/mantl-universe/blob/version-0.6/repo/packages/C/cassandra/2/config.json) has all of the config options that are available.

Hope this helps.

I used the cassandra.json available in examples/kong with the same result. I tried this command to post the json request - 

 curl --insecure -X POST -u admin --data @./examples/kong/cassandra.json https://192.168.100.101/api/1/install

Yes, it is the standard Vagrantfile setup I am trying on my Linux machine and the two nodes are the default control-01 and worker-001. This of course tries to install as a "package". So, the questions are - + Is this the right method to install a framework (use the --data with filename instead of -d and package name )?+ If not, what's the method to use a custom installation on mesos?+ What's the difference between a package and a framework? Is it an app running tasks on Mesos framework using Marathon ?

I'd recommend reviewing the Mesos documentation if you're new to using it. It outlines what a framework is. Those are what you install via mantl-api.

Here's the outline of Marathon, as well. Marathon is mostly used for running containerized workloads on top of Mesos.

I am not sure if that answers the question. My question is specific to mantl-api usage for framework - so let's be specific.My first question asks the right method to install a custom framework using the mantl-api CLI which is what I tried previously. Please follow the discussion from the beginning to get the context.As far as I know, there isn't a definition of package within Mesos, so was my last question.
Above pointers to generic documentation don't answer these specific questions.

@ashmehro Sorry, I was just trying to point you in the right direction for understanding the difference between Mesos frameworks and other apps that run in Marathon. Specifically with mantl-api, I think we use the words "package" and "framework" interchangeably. A package could be something other other than a framework, but in practice, we don't have like that any yet.

The -d and --data options are equivalent in curl.

In your second command, you are attempting to install a custom version of the cassandra framework, rather than the default (which you would get with just "{\"name\": \"cassandra\"}").

ryane commented

The Mantl "packages" you install via mantl-api are just pre-configured applications that run in marathon. For the most part, they are Mesos frameworks but can be anything that runs in Marathon. Installing the Cassandra Mesos framework manually is definitely an option but, if you want to install the packaged version with mantl-api, then you are following the correct procedure.

However, it looks like it is going to be very difficult to run cassandra with a default vagrant configuration. There is just not enough memory available to do so. I suggest you customize your Vagrant installation. See http://docs.mantl.io/en/latest/getting_started/vagrant.html#vagrant

I was able to get cassandra running by making the following changes (YMMV).

vagrant-config.yml

---
worker_cpus: 2
worker_memory: 3072

Rebuild vagrant cluster.

cassandra.json

{
  "name": "cassandra",
  "config": {
    "cassandra": {
      "cluster-name": "mantl",
      "node-count": 1,
      "seed-count": 1,
      "framework": {
        "cpus": 0.5,
        "mem": 256
      },
      "resources": {
        "cpus": 0.5,
        "mem": 512
      }
    }
  }
}

That customizes the Cassandra framework to run a single node. The framework scheduler is configured to use 0.5 cpus and 256 mbs of memory. The single Cassandra node is configured to use 0.5 cpus and 512 mbs of memory.

I can install it with:

curl -sku $creds -XPOST -d @cassandra.json https://192.168.100.101/api/1/install

where $creds is my username:password combo.

ryane commented

I'm going to close this. Please re-open if you are still having problems