本文介绍了设置码头/无孔Mesos环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在设法建立一个docker / fig Mesos集群。 我是新来的无花果和Docker。 Docker有大量的文档,但是我发现自己很难理解如何使用图。 这是我的fig.yaml: zookeeper: image:jplock / zookeeper ports: - 49181:2181 mesosMaster: image:mesosphere / mesos:0.19.1 ports: - 15050:5050 links: - zookeeper:zk 命令:mesos -master -zk = zk --work_dir = / var / log --quorum = 1 mesosSlave: image:mesosphere / mesos:0.19.1 links: - zookeeper:zk 命令:mesos-slave --master = zk 谢谢! p> 编辑: 感谢Mark O`Connor的帮助,我我们创建了一个基于停靠码头的工作台(+风暴,时间和更多的时间)。 享受,如果你觉得这很有用 - 请贡献: https://github.com/yaronr/docker-mesos PS。请+1 Mark的答案:)解决方案您没有指出您遇到的错误。 这是您使用的图片的文档: https://registry.hub.docker.com/u/mesosphere/mesos/ 真正让我担心的是这些图像是它们是不可信的,没有源代码立即可用。 所以我使用中间层github重新创建了你的例子作为灵感: https://github.com/mesosphere/docker-containers 更新示例 更新的示例包括chronos框架 ├──build.sh ├──fig.yml ├──mesos │└──Dockerfile ├──mesos-chronos │└──Dockerfile ├──mesos-master │└──Dockerfile └─ ─mesos-slave └──Dockerfile 构建基本图像(只需要完成一次) ./ build.s h 运行fig启动每个服务的实例: $ fig up -d 创建mesos_zk_1 ... 创建mesos_master_1 ... 创建mesos_slave_1 ... 创建mesos_chronos_1 ... 关于fig的一个有用的东西是你可以扩展从属 $ fig scale slave = 5 启动mesos_slave_2 ... 启动mesos_slave_3 ... 开始mesos_slave_4 ... 启动mesos_slave_5 ... mesos主控台应显示5个从站运行 http:// localhost:15050 /#/ slaves 并且chronos框架应该运行并准备启动任务 http:// localhost:14400 fig.yml zk: image:mesos 命令:/usr/share/zookeeper/bin/zkServer.sh start-foreground master: B uild:mesos-master ports: - 15050:5050 links: - zk:zookeeper slave: build:mesos -slave links: - zk:zookeeper chronos: build:mesos-chronos ports: - 14400:4400链接: - zk:zookeeper 注意: 此示例仅需要zookeeper的单个实例 build.sh docker build --rm = true --tag = mesos mesos mesos / Dockerfile FROM ubuntu:14.04 维护者Mark O'Connor< [email protected]> RUN echodeb http://repos.mesosphere.io/ubuntu/ trusty main> /etc/apt/sources.list.d/mesosphere.list 运行apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF 运行apt-get -y update 运行apt-get -y安装mesos马拉松计时器 mesos-master / Dockerfile FROM mesos 维护者Mark O'Connor< [email protected]> EXPOSE 5050 CMD [--zk = zk:// zookeeper:2181 / mesos,--work_dir = / var / lib / mesos --quorum = 1] ENTRYPOINT [mesos-master] mesos-slave / Dockerfile FROM mesos 维护者Mark O'Connor< [email protected]> CMD [--master = zk:// zookeeper:2181 / mesos] ENTRYPOINT [mesos-slave] mesos-chronos / Dockerfile FROM mesos 维护者Mark O'Connor< [email protected]> RUN echozk:// zookeeper:2181 / mesos> / etc / mesos / zk EXPOSE 4400 CMD [chronos] 注意: 使用文件配置chronos命令行。 I'm trying to set up a docker / fig Mesos cluster.I'm new to fig and Docker. Docker has plenty of documentation, but I find myself struggling to understand how to work with fig.Here's my fig.yaml at the moment:zookeeper: image: jplock/zookeeper ports: - "49181:2181"mesosMaster: image: mesosphere/mesos:0.19.1 ports: - "15050:5050" links: - zookeeper:zk command: mesos-master --zk=zk --work_dir=/var/log --quorum=1mesosSlave: image: mesosphere/mesos:0.19.1 links: - zookeeper:zk command: mesos-slave --master=zkThanks !Edit:Thanks to Mark O`Connor's help, I've created a working docker-based mesos setup (+ storm, chronos, and more to come).Enjoy, and if you find this useful - please contribute:https://github.com/yaronr/docker-mesosPS. Please +1 Mark's answer :) 解决方案 You have not indicated the errors you were experiencing.This is the documentation for the image you're using: https://registry.hub.docker.com/u/mesosphere/mesos/What really worried me about those images is that they were untrusted and no source was immediately available.So I re-created your example using the mesosphere github as inspiration:https://github.com/mesosphere/docker-containersUpdated ExampleExample updated to include the chronos framework├── build.sh├── fig.yml├── mesos│   └── Dockerfile├── mesos-chronos│   └── Dockerfile├── mesos-master│   └── Dockerfile└── mesos-slave └── DockerfileBuild the base image (only has to be done once)./build.shRun fig to start an instance of each service:$ fig up -dCreating mesos_zk_1...Creating mesos_master_1...Creating mesos_slave_1...Creating mesos_chronos_1...One useful thing about fig is that you can scale up the slaves$ fig scale slave=5Starting mesos_slave_2...Starting mesos_slave_3...Starting mesos_slave_4...Starting mesos_slave_5...The mesos master console should show 5 slaves runninghttp://localhost:15050/#/slavesAnd the chronos framework should be running and ready to launch taskshttp://localhost:14400fig.ymlzk: image: mesos command: /usr/share/zookeeper/bin/zkServer.sh start-foregroundmaster: build: mesos-master ports: - "15050:5050" links: - "zk:zookeeper"slave: build: mesos-slave links: - "zk:zookeeper"chronos: build: mesos-chronos ports: - "14400:4400" links: - "zk:zookeeper"Notes:Only single instance of zookeeper needed for this examplebuild.shdocker build --rm=true --tag=mesos mesosmesos/DockerfileFROM ubuntu:14.04MAINTAINER Mark O'Connor <[email protected]>RUN echo "deb http://repos.mesosphere.io/ubuntu/ trusty main" > /etc/apt/sources.list.d/mesosphere.listRUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BFRUN apt-get -y updateRUN apt-get -y install mesos marathon chronosmesos-master/DockerfileFROM mesosMAINTAINER Mark O'Connor <[email protected]>EXPOSE 5050CMD ["--zk=zk://zookeeper:2181/mesos", "--work_dir=/var/lib/mesos", "--quorum=1"]ENTRYPOINT ["mesos-master"]mesos-slave/DockerfileFROM mesosMAINTAINER Mark O'Connor <[email protected]>CMD ["--master=zk://zookeeper:2181/mesos"]ENTRYPOINT ["mesos-slave"]mesos-chronos/DockerfileFROM mesosMAINTAINER Mark O'Connor <[email protected]>RUN echo "zk://zookeeper:2181/mesos" > /etc/mesos/zkEXPOSE 4400CMD ["chronos"]Notes:The "chronos" command line is configured using files. 这篇关于设置码头/无孔Mesos环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-23 18:10