马拉松说“资源不足”和“资源不足”。对于需要少于可用任务的任务

时间:2016-12-13 15:27:44

标签: resources mesos marathon

我通过公共IP提供Mesos Master。

我有一个提供一些资源的奴隶。

我尝试部署一个小应用程序,但Marathon回复

25646:[2016-12-13 15:26:57,440] INFO Offer [bd40f00f-ce24-4014-b1b1-82db64e68c10-O92]. Considering resources with roles {*} without resident reservation labels. Insufficient ports in offer for run spec [/nginx-test-n2] (mesosphere.marathon.tasks.PortsMatcher:marathon-akka.actor.default-dispatcher-1073)
25647:[2016-12-13 15:26:57,440] INFO Offer [bd40f00f-ce24-4014-b1b1-82db64e68c10-O92]. Insufficient resources for [/nginx-test-n2] (need cpus=0.2, mem=32.0, disk=0.0, gpus=0, ports=(), available in offer: [id { value: "bd40f00f-ce24-4014-b1b1-82db64e68c10-O92" } framework_id { value: "40aadcc7-8e0f-4634-af46-29d9c33bc03e-0000" } slave_id { value: "bd40f00f-ce24-4014-b1b1-82db64e68c10-S1" } hostname: "myproj-slave-vm-1" resources { name: "disk" type: SCALAR scalar { value: 3985.0 } role: "*" } resources { name: "cpus" type: SCALAR scalar { value: 0.6 } role: "*" } resources { name: "mem" type: SCALAR scalar { value: 6478.0 } role: "*" } url { scheme: "http" address { hostname: "myproj-slave-vm-1" ip: "10.1.10.20" port: 5051 } path: "/slave(1)" }] (mesosphere.mesos.TaskBuilder$:marathon-akka.actor.default-dispatcher-1073)

曾经展开的是:

25628:[2016-12-13 15:26:52,425] INFO Offer [bd40f00f-ce24-4014-b1b1-82db64e68c10-O91]. 
Insufficient resources for [/nginx-test-n2] (need 
    cpus=0.2, 
    mem=32.0, 
    disk=0.0, 
    gpus=0, 
    ports=(), 
available in offer: 
[id {
        value: "bd40f00f-ce24-4014-b1b1-82db64e68c10-O91"
    }
    framework_id {
        value: "40aadcc7-8e0f-4634-af46-29d9c33bc03e-0000"
    }
    slave_id {
        value: "bd40f00f-ce24-4014-b1b1-82db64e68c10-S1"
    }
    hostname: "myproj-slave-vm-1"
    resources {
        name: "disk"
        type: SCALAR scalar {
            value: 3985.0
        }
        role: "*"
    }
    resources {
        name: "cpus"
        type: SCALAR scalar {
            value: 0.6
        }
        role: "*"
    }
    resources {
        name: "mem"
        type: SCALAR scalar {
            value: 6478.0
        }
        role: "*"
    }
    url {
        scheme: "http"
        address {
            hostname: "myproj-slave-vm-1"
            ip: "10.1.10.20"
            port: 5051
        }
        path: "/slave(1)"
    }
]

我无法理解为什么马拉松会说'资源不足',因为从日志中可以看出有足够的资源......

1 个答案:

答案 0 :(得分:0)

我通过将resources=ports:[1-65000]添加到代理执行命令来解决它:

/usr/sbin/mesos-slave --master=10.2.0.56:5050 --work_dir=/var/lib/mesos/agent --containerizers=docker --executor_registration_timeout=3mins --log_dir=/var/log/mesos --resources=ports:[1-65000] --advertise_ip=10.1.10.20 --advertise_port=5051