用marathon部署一个ubuntu应用
1.要求:
用marathon部署一个ubuntu应用,每一秒向mesos的sandbox输出一次当前时间
2.方案:
cat ubuntu.json
{
"id": "ubuntu-marathon",
"instances": 2,
"cpus": 0.5,
"mem": 256,
"uris": [],
"cmd": "while true; do ( echo 'HTTP/1.0 200 Ok'; echo; echo date -u +%T 'Hello World From ubuntu!' ) | nc -l $PORT; done",
"container": {
"type": "DOCKER",
"docker": {
"image": "libmesos/ubuntu"
}
}
}
3.测试:
1.能在mesos中查看相应输出的时间
2.通过docker ps 能看到该容器的运行信息
4.说明:
1.通过部署Ubuntu系统镜像来验证,marathon+mesos在管理操作系统容器的靠谱性
2.为后续微服务做知识探索