【云星数据---mesos实战系列】:marathon实战Constraints篇-002
来源:互联网 发布:excel如何去除重复数据 编辑:程序博客网 时间:2024/06/08 19:34
CLUSTER operator
CLUSTER allows you to run all of your app’s tasks on slaves that share a certain attribute. This
is useful for example if you have apps with special hardware needs, or if you want to run them
on the same rack for low latency.
$ curl -v -X POST http://192.168.100.30:8080/v2/apps \ -H Content-Type:application/json -d '{ "id":"dataman", "container": { "type": "DOCKER", "docker": { "image": "192.168.100.13:5000/fchen/mynginx", "network": "BRIDGE", "portMappings": [ { "containerPort": 80, "hostPort": 0, "protocol": "tcp"} ] } }, "constraints": [["rack_id", "CLUSTER", "rack-1"]], "cmd": "/usr/sbin/nginx -c /etc/nginx/nginx.conf", "cpus": 0.1, "mem": 128.0, "instances": 5 }'
CLUSTER允许我们将app发布到Mesos特定的slave节点上。如果你的app对物理机的硬件有要
求,那么这个特性就很有用了。
我们可以看到marathon将我们的app都发布到了rack1节点上去了。
$curl -v -X POST http://192.168.100.30:8080/v2/apps \ -H Content-Type:application/json -d '{ "id":"dataman", "container": { "type": "DOCKER", "docker": { "image": "192.168.100.13:5000/fchen/mynginx", "network": "BRIDGE", "portMappings": [{ "containerPort": 80, "hostPort": 0, "protocol": "tcp" }] } }, "constraints": [["hostname", "CLUSTER", "192.168.100.27"]], "cmd": "/usr/sbin/nginx -c /etc/nginx/nginx.conf", "cpus": 0.1, "mem": 128.0, "instances": 2 }'
我们还可以指定field name为hostname,并将optional parameter指定为我们希望app运行的slave的hostname。这样我们将2个dataman的instance发布到了192.168.100.27这台slave上。
阅读全文
0 0
- 【云星数据---mesos实战系列】:marathon实战Constraints篇-002
- 【云星数据---mesos实战系列】:marathon实战Constraints篇-001
- 【云星数据---mesos实战系列】:marathon实战Constraints篇-003
- 【云星数据---mesos实战系列003】:marathon实战006--用marathon部署一个ubuntu应用
- 【云星数据---mesos实战系列003】:marathon实战007--marathon部署一个docker register
- 【云星数据---mesos实战系列003】:marathon实战009--marathon部署一个springboot应用
- 【云星数据---mesos实战系列003】:marathon实战002--marathon部署http版的hello world应用
- 【云星数据---mesos实战系列002】:mesos全分布式部署实战009--修改marathon的默认端口
- 【云星数据---mesos实战系列002】:mesos全分布式部署实战008--配置mesos-master和marathon的高可用
- 云星数据---mesos实战系列003】:marathon实战001--使用marathon部署一个最简单的容器服务
- 【云星数据---mesos实战系列003】:marathon实战003--marathon部署一套最简单的Nginx环境
- 【云星数据---mesos实战系列003】:marathon实战004--marathon部署一套Tomcat环境(精简代码版)
- 【云星数据---mesos实战系列003】:marathon实战004--marathon部署一套Tomcat环境(精简代码版)
- 【云星数据---mesos实战系列003】:marathon实战005--marathon部署一套pyhton3的web程序
- 【云星数据---mesos实战系列003】:marathon实战008--marathon部署一套最简单的前端程序
- 【云星数据---mesos实战系列003】:marathon实战008--marathon部署一套最简单的前端程序
- 【云星数据---mesos实战系列002】:mesos全分布式部署实战002--Java准备
- 【云星数据---mesos实战系列002】:mesos全分布式部署实战001--机器准备
- mxGraph 导出图片节点中文乱码问题解决方案
- Java线程简析
- 自动化运维之ansible的ad-hoc
- 初次熟悉使用jenkins 持续集成
- 雅虎初始化css
- 【云星数据---mesos实战系列】:marathon实战Constraints篇-002
- Mistral 经典案例
- LeetCode-121. Best Time to Buy and Sell Stock
- 解决初学javaWeb者缺少Mysql数据库连接的Jar包引起的问题。
- LeetCode--Minimum Depth of Binary Tree
- Android获取APP的应用程序名称、包名、图标,版本号基本信息
- Java中的集合类Collection类
- 国家气象局提供的天气预报接口
- java 技巧