1

I'm running a mesos + marathon cluster and so far everything works fine. But I can't figure out how to use constraints in marathon.

I have tagged my mesos slaves with attributes

$ cat /etc/mesos-slave/attributes/category
SERVICE

To the marathon description for my container I added

"constraints": [["category", "CLUSTER", "SERVICE"]]

But when I deploy my container I only get "INFO No matching offer for " and I can't figure out what I did wrong.

Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: [2015-06-30 08:08:48,812] INFO No matching offer for <CONTAINER> (need cpus=0.1, mem=3072.0, disk=0.0,
ports=List(0)) : id {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   value: "20150616-090516-2130907308-5050-1304-O1291851"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: framework_id {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   value: "20150330-112621-2130907308-5050-25763-0000"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: slave_id {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   value: "20150616-090516-2130907308-5050-1304-S49"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: hostname: "<HOSTNAME>"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: resources {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   name: "cpus"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   type: SCALAR
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   scalar {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:     value: 0.3999999999999999
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   role: "*"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: resources {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   name: "mem"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   type: SCALAR
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   scalar {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:     value: 4911.0
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   role: "*"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: resources {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   name: "disk"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   type: SCALAR
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   scalar {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:     value: 14896.0
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   role: "*"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: resources {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   name: "ports"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   type: RANGES
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   ranges {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:     range {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:       begin: 31003
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:       end: 32000
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:     }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   role: "*"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: attributes {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   name: "category"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   type: TEXT
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   text {
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:     value: "SERVICE"
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:   }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: }
Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]:  (mesosphere.mesos.TaskBuilder:47)    

Is there anything I am missing?

hammi
  • 161
  • 1
  • 8

1 Answers1

1

From the logs, it looks like your task needs mem=3072.0, but is only being offered 1903.0. You should see the same error even without the constraints. Either reduce the memory requirements on your task, or increase the memory available to Mesos/Marathon on your nodes.

Adam
  • 4,322
  • 1
  • 16
  • 22
  • Thanks Adam for the answer. I took the wrong log and I changed it to a more clear one. But you were right in the log I posted earlier the reason was RAM. But next to that did I miss something or did I do something wrong? – hammi Jun 30 '15 at 09:29
  • If you don't see an "Offer did not satisfy constraints for app... Conflicting constraints are:..." log warning, then it's not a constraint-matching problem. The only other thing I can think of is that you're asking for `ports=List(0)` which is not in the range 31003-32000. However, specifying port 0 should claim any available port and map it to $PORT0. Is there any more relevant information in the preceding log lines? – Adam Jun 30 '15 at 09:55
  • Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: [2015-06-30 08:08:48,812] WARN Offer did not satisfy constraints for app []. Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: Conflicting constraints are: [field: "category" Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: operator: CLUSTER Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: value: "SERVICE" Jun 30 08:08:48 ip-172-16-3-95 marathon[13100]: ] (mesosphere.mesos.TaskBuilder:190) I get both of the messages you suggested! Are there any other informations I can provide you? – hammi Jun 30 '15 at 10:10
  • Is this "Conflicting constraints" log message immediately before the "No matching offer" message? Because it looks like the conflicting constraint is "[field: "category", operator: CLUSTER, value: "SERVICE"]" and the offer has "attributes {name: "category", type: TEXT, text {value: "SERVICE"}}" which I would expect to match. The only thing I can think of is that you are getting offers that match the constraint, but don't have enough resources; or you are getting offers that don't actually match the constraint. How many of your slaves have that attribute set? All? Only a few? – Adam Jul 01 '15 at 08:43
  • In this Cluster I have only 5 slave nodes and 2 have this value set. The rest of the nodes have different ones. For a test I scaled up to 8, just to make sure I have enough resources but that didn't change anything. I'm running out of ideas what I might did wrong in the configuration. Sadly the part of how to set the attributes on the slave isn't very well documented (for my opinion) and I couldn't find any good howtos either. – hammi Jul 01 '15 at 09:08