2015-06-30 44 views
1

我正在運行mesos + marathon集羣,到目前爲止一切正常。但我無法弄清楚如何在馬拉松中使用約束。使用馬拉松限制的問題

我已標記我mesos奴隸與屬性

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

的馬拉松說明對我的容器,我添加

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

但是當我部署我的容器,我只得到「信息的不匹配報價「我無法弄清楚我做錯了什麼。

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)  

有什麼我失蹤了嗎?

回答

1

從日誌看來,您的任務需要mem = 3072.0,但只能提供1903.0。即使沒有限制,你也應該看到相同的錯誤。減少任務的內存需求,或增加節點上Mesos/Marathon的可用內存。

+0

感謝亞當的答案。我拍下了錯誤的日誌,並將其更改爲更清晰的日誌。但是你在我之前發佈的日誌中是正確的,原因是RAM。 但在旁邊,我錯過了什麼,或者我做錯了什麼? – hammi

+0

如果您沒有看到「提供不滿足應用程序的約束......衝突約束是:...」日誌警告,那麼它不是一個約束匹配問題。我唯一能想到的另一件事是,你要求的是不在範圍31003-32000內的'ports = List(0)'。但是,指定端口0應聲稱任何可用的端口並將其映射到$ PORT0。上述日誌行中是否還有更多相關信息? – Adam

+0

Jun 30 08:08:48 ip-172-16-3-95 marathon [13100]:[2015-06-30 08:08:48,812] WARN Offer未滿足應用限制[]。 Jun 30 08:08:48 ip-172-16-3-95 marathon [13100]:衝突的約束是:[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馬拉松[13100]:](mesosphere.mesos.TaskBuilder:190) 我同時得到了你建議的消息!我可以提供哪些其他信息? – hammi