设置码头/无孔Mesos环境 [英] Setting up a docker / fig Mesos environment
问题描述
我是新来的无花果和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的答案:)
您没有指出您遇到的错误。
这是您使用的图片的文档:
Mesos base Docker从
中使用Mesosphere包 https:/ /mesosphere.io/downloads/ 。不要启动Mesos,请使用
mesos-master和mesos-slave Dockers。
真正让我担心的是这些图像是它们是不可信的,没有源代码立即可用。
所以我使用中间层github重新创建了你的例子作为灵感:
更新示例
更新的示例包括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< mark@myspotontheweb.com>
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< mark@myspotontheweb.com>
EXPOSE 5050
CMD [--zk = zk:// zookeeper:2181 / mesos,--work_dir = / var / lib / mesos --quorum = 1]
ENTRYPOINT [mesos-master]
< h2> mesos-slave / Dockerfile
FROM mesos
维护者Mark O'Connor< mark@myspotontheweb.com>
CMD [--master = zk:// zookeeper:2181 / mesos]
ENTRYPOINT [mesos-slave]
mesos-chronos / Dockerfile
FROM mesos
维护者Mark O'Connor< mark@myspotontheweb.com>
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=1
mesosSlave:
image: mesosphere/mesos:0.19.1
links:
- zookeeper:zk
command: mesos-slave --master=zk
Thanks !
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-mesos
PS. Please +1 Mark's answer :)
You have not indicated the errors you were experiencing.
This is the documentation for the image you're using:
Mesos base Docker using the Mesosphere packages from https://mesosphere.io/downloads/. Doesn't start Mesos, please use the mesos-master and mesos-slave Dockers.
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:
Updated Example
Example updated to include the chronos framework
├── build.sh
├── fig.yml
├── mesos
│ └── Dockerfile
├── mesos-chronos
│ └── Dockerfile
├── mesos-master
│ └── Dockerfile
└── mesos-slave
└── Dockerfile
Build the base image (only has to be done once)
./build.sh
Run fig to start an instance of each service:
$ fig up -d
Creating 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=5
Starting mesos_slave_2...
Starting mesos_slave_3...
Starting mesos_slave_4...
Starting mesos_slave_5...
The mesos master console should show 5 slaves running
http://localhost:15050/#/slaves
And the chronos framework should be running and ready to launch tasks
http://localhost:14400
fig.yml
zk:
image: mesos
command: /usr/share/zookeeper/bin/zkServer.sh start-foreground
master:
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 example
build.sh
docker build --rm=true --tag=mesos mesos
mesos/Dockerfile
FROM ubuntu:14.04
MAINTAINER Mark O'Connor <mark@myspotontheweb.com>
RUN echo "deb http://repos.mesosphere.io/ubuntu/ trusty main" > /etc/apt/sources.list.d/mesosphere.list
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
RUN apt-get -y update
RUN apt-get -y install mesos marathon chronos
mesos-master/Dockerfile
FROM mesos
MAINTAINER Mark O'Connor <mark@myspotontheweb.com>
EXPOSE 5050
CMD ["--zk=zk://zookeeper:2181/mesos", "--work_dir=/var/lib/mesos", "--quorum=1"]
ENTRYPOINT ["mesos-master"]
mesos-slave/Dockerfile
FROM mesos
MAINTAINER Mark O'Connor <mark@myspotontheweb.com>
CMD ["--master=zk://zookeeper:2181/mesos"]
ENTRYPOINT ["mesos-slave"]
mesos-chronos/Dockerfile
FROM mesos
MAINTAINER Mark O'Connor <mark@myspotontheweb.com>
RUN echo "zk://zookeeper:2181/mesos" > /etc/mesos/zk
EXPOSE 4400
CMD ["chronos"]
Notes:
- The "chronos" command line is configured using files.
这篇关于设置码头/无孔Mesos环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!