我有一个dockerized spring-boot应用程序,需要在mesos / chronos(DC / OS)中安排。 有两个地方(我认为)可以用来完成Chronos调度:
1)使用“command”标签 2)使用“容器”标签
Chronos命令标记的一个例子是:
{
"name": "my-dockerized-app",
"command": "docker login -u my_username -p my_password -e dev-my_user@my_company.com;docker run -e id=123 my_owner/my_dockerized_app_image:latest",
"shell": true,
"epsilon": "PT60S",
"executor": "",
"executorFlags": "",
"retries": 2,
"owner": "",
"ownerName": "",
"description": "",
"async": false,
"successCount": 0,
"errorCount": 264,
"lastSuccess": "",
"lastError": "",
"cpus": 0.5,
"disk": 256.0,
"mem": 512.0,
"disabled": false,
"softError": false,
"dataProcessingJobType": false,
"errorsSinceLastSuccess": 264,
"uris": [],
"environmentVariables": [{
"name": "id",
"value": "1"
}],
"arguments": [],
"highPriority": false,
"runAsUser": "root",
"constraints": [],
"schedule": "R/2016-11-21T05:06:00.000Z/PT2M",
"scheduleTimeZone": ""
}
Chronos“容器”标签的一个例子:
{
"schedule": "R\/2014-09-25T17:22:00Z\/PT2M",
"name": "my_docker_job",
"container": {
"type": "DOCKER",
"image": "my_owner/my_dockerized_app",
"network": "BRIDGE"
},
"cpus": "0.5",
"mem": "512",
"uris": [],
""
}
在Mesos / Chronos生产环境中应该真正使用哪些调度方法?
答案 0 :(得分:0)
您应该使用第二个选项
这两种配置的不同之处在于Mesos将与docker交互的方式。